View Single Post
Old 01-15-2010, 12:07 AM  
SmellyNose
Confirmed User
 
SmellyNose's Avatar
 
Industry Role:
Join Date: Aug 2009
Location: me at smellynose.com
Posts: 206
Quote:
Originally Posted by mkx View Post
hmm cant figure it out, heres my code:

Code:
$alltags = mysql_query("SELECT * FROM tags WHERE user_id=$id");


while($row1 = mysql_fetch_array($alltags))
  {
echo $row1['tag_cen']; //i want to echo fields here instead of just tag_cen

  }
Add another echo in your while loop to see if it is actually going into it.

And add:
Code:
if($alltags === false) {
    die("Query failed");
}
uk3.php.net/mysql_fetch_array

And $id is definitely numeric isn't it?

Code:
$id = preg_replace('/[^0-9]/', '', $id);
Otherwise you could be open to mysql injection
SmellyNose is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote