While returning no results

Cazpa

New Member
I've got the following query in an existing script - but it's not always returning a value even though it should based off what's in the database. There are plenty of things in the database it SHOULD be grabbing - they are there.Don't see anything wrong with it - but I barely do this anymore :) See anything?\[code\]$query = "SELECT id FROM xtags WHERE tag_id = '$tagid' ORDER BY RAND() Limit 2";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_array($result)){ $query = "SELECT * FROM xtable WHERE id = '$row[id]'"; $result = mysql_query($query) or die(mysql_error()); $row2 = mysql_fetch_assoc($result); echo $row2[title];}\[/code\]
 
Back
Top