Jump to content

Fruct0se

Members
  • Posts

    108
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Fruct0se's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok I figured it out...not enough caffeine in my system today. I was using mysql_fetch_row when I should have been using mysql_fetch_assoc
  2. This always works fine except for some reason when using the LIKE statement. I am trying to return a group of rows and call them out by their column names. So if I have a column called NAME then when extracting the row I normally can reference that result by echoing $NAME, when using the like statement it is returning 0 and 1 etc... for the column names, any ideas? <?php $result = mysql_query("Select * from images where NAME like '$search%'"); while($i = mysql_fetch_row($result)){ //This for each will echo: 0 NAMEofIMAGE foreach ($i as $name=>$val) { echo "$name is a $val <BR/>"; } //This will echo nothing for the $NAME because the query is not returning the column names extract($i); echo "<b>Name: ".$NAME."</b><br/>"; } ?> Like I said, without the LIKE statement the column names are returned and when extracted can be used. Thanks for the help.
  3. <td class="thead" width="50%" align="left"><a href="YOUR LINK"><?php print $title; ?></a></td>
  4. Ok I figured it out: I had to log into ssh bash and go to the mysql terminal. Then I had to add privileges to the user trying to access the database from a different domain. For anyone that is interested these are the commands used: CREATE USER 'username'@'IP' IDENTIFIED BY 'username'; GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , FILE , INDEX , ALTER , EXECUTE ON * . * TO 'username'@'IP' IDENTIFIED BY 'password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; GRANT ALL PRIVILEGES ON `database` . * TO 'username'@'IP'; The above will create a user, give permissions on that IP to access the DB as well as permissions to modify it.
  5. if your just trying to get the results from the query where it matched then add the following lines after your query: $result=mysql_query($query); while ($row = mysql_fetch_row ($result)) { extract($row); echo "$text<br/>"; }
  6. I havent tested but this should work or at least point you to what your trying to do: $query="SELECT moj_genre, genre_id FROM genres, genrelinkcd WHERE genre.genre_id = genrelinkcd.moj_id AND genrelinkcd.moj_id='$id'"; $result=mysql_query($query); while ($row = mysql_fetch_row ($result)) { extract($row); echo "moj_genre: $moj_genre, genre_id: $genre_id"; }
  7. Do a view source on the page that shows the login for your webmail. You should see what the fields are called for the username and password as well as where they are posting to. Then all you have to do is replicate that form anywhere you want on your site.
  8. I have a dedicated server which I can access through PLESK... I have two seperate sites, one is a .com and the other a .mobi for cell phone users. Is there a way that both sites can access the same db? The main DB is on the .com but it appears that each site is given its own seperate db's I thought using just localhost since it was on the same machine it would work but it does not, any ideas would be great.
  9. The problem is not actually php. Try setting some fixed widths for your tables, so everywhere you have <td> change it set the width you want: <td width="200"> This will fix the width of each cell, right now your table is only going to be the size of whatever is inside it.
  10. Thanks, can you show me an easy way to show all the data in the array?
  11. I am pulling a table from my database and I would like to store all of the information into a single array. The table would look something like this: table name: taxonomy IDCategoryidHidW 1Standard100300 2Standard200320 3Standard300390 4Other1030 5Other23020 6Other33010 I would like to store all of this information into a single array something like: $result = $db->query("Select * from taxonomy"); while ($i = $db->fetch_row($result)){ extract($i); //!*****Want to store all the data into a single array here***** }
  12. 10k seems a bit high to me as well, even 2500. Unless of course the site already has a decent amount of traffic coming its way.
  13. This is actually most likely working, however you have both + and - in the same form so when you submit it both + and - will be set. This means that your code will add 1 then immediately subtract 1.
  14. echo "<td>City Search:</td>"; echo '<td><select Name="A_City">'; for($i=0;$i<=$nbcities;$i++) { echo '<option value="'.$cityset[CITY_ID][$i].'">'.$cityset[CITY_NAME][$i]."</option>\n"; } echo "</select>";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.