Jump to content

what is the php command to end mysql_fetch_array prematurely?


Fog Juice

Recommended Posts

Is there a php function to end a while loop using mysql_fetch_array before it reads through all the records?

 

 

while($row=mysql_fetch_array($results))

{

 

        if($a == $row['id'])

        {

              end(); ? <--- looking for something here to stop the while loop, any suggestions?

        }

 

}

 

 

Thanks in advance to anyone that helps!

You're looking for break, or exit;

 

In your example above... 'SELECT * FROM SOMEWHERE where id=$a'

 

 

yes i know, the example is just hypothetical and was only just typed up to give an example of what i'm looking for.

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.