Hi all... this is my code and the sql is only pulling out 1 row... im baffled as to why. any ideas anyone?
<?
$sql3 = "SELECT * FROM wall WHERE id='".$userUNid."' ORDER BY orderid DESC LIMIT 3";
$results = mysql_query($sql3);
$arr = mysql_fetch_row($results);
$message = $arr[2];
$postid = $arr[3];
$sql2 = mysql_query("SELECT * FROM members WHERE id='".$postid."' ") or die ('Error: '.mysql_error ());
while($row = mysql_fetch_array($sql2))
{
echo "<h2 style='padding: 0px; margin: 15px 0px 7px 0px;'>Dougout</h2><div class='dogoutimg'><img src='http://www.jdbesly.co.uk/test/home/upload/";
echo $row['image'] ;
echo "' style='width: 60px;' /></div><div class='dougout' style='float: right;'>";
echo $message;
echo "</div>";
}
mysql_close($con);
?>
Report this post
MySQL only returning one row - PLEASE HELP...
Moderator: General Moderators
Re: MySQL only returning one row - PLEASE HELP...
Assuming that you have a proper DB design, obviously it's because of the WHERE clause
WHERE id='".$userUNid."'
So, I don't think wall.id should be used.
WHERE id='".$userUNid."'
So, I don't think wall.id should be used.
There are 10 types of people in this world, those who understand binary and those who don't
Re: MySQL only returning one row - PLEASE HELP...
the ptoblem is that i have an image in another table im trying to link to an id in another table.... so if that id matchess the image id.. show that picture with the other id's mesage