sp@rky13 Posted November 14, 2009 Share Posted November 14, 2009 Here's my code: <?php $con = mysql_connect("****","***","****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("******", $con); $result = mysql_query("SELECT * FROM village9 JOIN player9 ON village9.player = player9.id WHERE player9.name = 'gianni23';") or die(mysql_error()); if($row = mysql_fetch_array($result)) { echo $row['x']."|".$row['y']." "; } mysql_close($con); ?> It returns only one results instead of about 500. Why is that? Note: I would have posted this in the mysql section but no one replies there so there's no point, sorry Link to comment https://forums.phpfreaks.com/topic/181454-solved-solved-code-not-working/ Share on other sites More sharing options...
Maq Posted November 14, 2009 Share Posted November 14, 2009 Change this: if($row = mysql_fetch_array($result)) to this: while($row = mysql_fetch_array($result)) How do you expect to traverse through the result set without a loop? Link to comment https://forums.phpfreaks.com/topic/181454-solved-solved-code-not-working/#findComment-957180 Share on other sites More sharing options...
sp@rky13 Posted November 14, 2009 Author Share Posted November 14, 2009 Thank you very much. Solved See what I mean by quick replies EDIT: Where's the solved thingo? Link to comment https://forums.phpfreaks.com/topic/181454-solved-solved-code-not-working/#findComment-957181 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.