MySQL only returning one row - PLEASE HELP...
Posted: Fri Feb 27, 2009 11:06 am
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
<?
$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