Jump to content

loop end of file EOF


jesushax

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/
Share on other sites

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/>";
  }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/92104-loop-end-of-file-eof/#findComment-471645
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.