TobesC Posted March 5, 2007 Share Posted March 5, 2007 whenever i do a $result-$row query and try to list the results with a while statement, it always cuts off the first result. how do i fix this? Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/ Share on other sites More sharing options...
jcbarr Posted March 5, 2007 Share Posted March 5, 2007 Why don't you show us an example of the code that gives you this error and we might be able to figure out what is wrong. Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/#findComment-200281 Share on other sites More sharing options...
boo_lolly Posted March 5, 2007 Share Posted March 5, 2007 you probably have this somewhere above your while loop: $row = mysql_fetch_array($result); Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/#findComment-200284 Share on other sites More sharing options...
superuser2 Posted March 5, 2007 Share Posted March 5, 2007 Yes that's probably what's going on, it's happened to me many a time. Each time mysql_fetch_array is called, it advances one row. So if you call it once before your loop, it advances one row before you start your loop. Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/#findComment-200289 Share on other sites More sharing options...
boo_lolly Posted March 5, 2007 Share Posted March 5, 2007 Yes that's probably what's going on, it's happened to me many a time. Each time mysql_fetch_array is called, it advances one row. So if you call it once before your loop, it advances one row before you start your loop. exactly. Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/#findComment-200293 Share on other sites More sharing options...
TobesC Posted March 5, 2007 Author Share Posted March 5, 2007 thanks a lot guys - that was it. happy php-ing. . . Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/#findComment-200300 Share on other sites More sharing options...
superuser2 Posted March 5, 2007 Share Posted March 5, 2007 Mark the topic solved using the 'Topic Solved' button. Link to comment https://forums.phpfreaks.com/topic/41334-solved-search-results/#findComment-200369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.