jesushax Posted February 20, 2008 Share Posted February 20, 2008 Hi im an amatuer asp coder, making the transation from asp to php just wondering whats the asp equviliant of If NOT rsCheckUser.EOF Then this is checking if the records are at the end of file meaning there are no records left so if where NOT at the end of the records then "do something" else "no records" cheers Quote Link to comment https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/ Share on other sites More sharing options...
rhodesa Posted February 20, 2008 Share Posted February 20, 2008 Are you looking for feof()? Quote Link to comment https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/#findComment-471640 Share on other sites More sharing options...
aschk Posted February 20, 2008 Share Posted February 20, 2008 Looks like you're enquiring about recordsets (i.e. database related recordsets). Thankfully PHP doesn't need to know about the EOF (because it's nice enough to handle it for you). For example: <?php // If number of records is greater than 0 if($mysql_num_rows() > 0) // Loop the set print_r'ing the result. // No need to handle EOF while($row = mysql_fetch_assoc($queryResult)){ print_r($row); echo "<br/>"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/#findComment-471645 Share on other sites More sharing options...
Daniel0 Posted February 20, 2008 Share Posted February 20, 2008 I.e. the mysql_fetch_*() functions will return false when there are no more rows left which will make the while loop stop. Quote Link to comment https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/#findComment-471663 Share on other sites More sharing options...
jesushax Posted February 20, 2008 Author Share Posted February 20, 2008 cheers for that Quote Link to comment https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/#findComment-471666 Share on other sites More sharing options...
aschk Posted February 20, 2008 Share Posted February 20, 2008 Ah yes, thanks Daniel0 that's exactly what I should have said, dang it... Quote Link to comment https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/#findComment-471742 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.