86Stang Posted January 16, 2008 Share Posted January 16, 2008 I'm doing a SELECT from the database and getting a conflict in the results. $sql = "SELECT * FROM members"; $result = mysql_query($sql) or die('Query failed.'); echo "You currently have " . mysql_num_rows($result) . " records.<br><br>"; $i=1; while ($row = mysql_fetch_array($result)) { echo "#" . $i . " - " . $row[19] . "<br>"; $i++; } The resulting output is: "You currently have 39 records" ... but when I do the while loop, it only shows 38 records. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/86387-solved-conflicting-database-results/ Share on other sites More sharing options...
teng84 Posted January 16, 2008 Share Posted January 16, 2008 because you have fetch already one data before you loop remove that fetch above and you should be fine Quote Link to comment https://forums.phpfreaks.com/topic/86387-solved-conflicting-database-results/#findComment-441430 Share on other sites More sharing options...
teng84 Posted January 17, 2008 Share Posted January 17, 2008 men did you edit your post.. i believe better to post your new code than editing your original thread this confused readers.i have posted answer already. is it my eyes that has a prob i believe i've seen 2 fetch array Quote Link to comment https://forums.phpfreaks.com/topic/86387-solved-conflicting-database-results/#findComment-441440 Share on other sites More sharing options...
PFMaBiSmAd Posted January 17, 2008 Share Posted January 17, 2008 LOL. The code in the first post was edited. Kind of makes you want to quote entire posts when you reply to them, even though that clutters up the thread, so you have a record in your post of what you were providing an answer to, so as not to look foolish. 86Stang, it is impolite to change your question. Quote Link to comment https://forums.phpfreaks.com/topic/86387-solved-conflicting-database-results/#findComment-441444 Share on other sites More sharing options...
86Stang Posted January 17, 2008 Author Share Posted January 17, 2008 Sorry about the edit. You're answer to my (pre-edited) post was dead on. Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/86387-solved-conflicting-database-results/#findComment-441445 Share on other sites More sharing options...
86Stang Posted January 17, 2008 Author Share Posted January 17, 2008 Again, my apologies. Quote Link to comment https://forums.phpfreaks.com/topic/86387-solved-conflicting-database-results/#findComment-441448 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.