returning to the first record in table after while loop

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
bizt
Forum Newbie
Posts: 1
Joined: Tue Nov 12, 2002 8:44 am
Location: Stirling, Scotland

returning to the first record in table after while loop

Post by bizt »

hi,
how do you return to the first record in a table after using the while loop????? What i want is to loop through a table using the below code:

while ($row = mysql_fetch_array($sql_query)) {
// code goes here
}

this works fine, but when i try to use the same while loop again in the script it does do anything. i remember from when looping through tables with other langauges you have to return to the first record in the table. if that is the case, how do i do that for the above????? cheers

martyn
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Post Reply