Pyro4816 Posted December 23, 2006 Share Posted December 23, 2006 OK, i have a code that works fine, except that it wont return the first result.[code] $result = $connector->query("SELECT * FROM messages WHERE r='0'"); $row = $connector->fetchArray($result); while ($row = $connector->fetchArray($result)){ echo $row['t']; echo '<br />'; }[/code]no in the database there are two items that have read set as 0, but it only returns the second one on, like i had 4 and it only returned 3. anyone know what im doing wrong? Link to comment https://forums.phpfreaks.com/topic/31654-solved-simple-sql-problem/ Share on other sites More sharing options...
michaellunsford Posted December 23, 2006 Share Posted December 23, 2006 you're doubling your $row=$connector... First by itself, then as part of a query. by the time you echo it, you've moved to the second record. Link to comment https://forums.phpfreaks.com/topic/31654-solved-simple-sql-problem/#findComment-146714 Share on other sites More sharing options...
Pyro4816 Posted December 23, 2006 Author Share Posted December 23, 2006 thanks alot, im a noob, i know. Link to comment https://forums.phpfreaks.com/topic/31654-solved-simple-sql-problem/#findComment-146720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.