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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.