The trick is in using the MySQL 0limit statement.

For the first record use: 

$sql = mysql_query("SELECT * FROM temp_table limit 0, 1");

then increment the limit for the next record

$sql = mysql_query("SELECT * FROM temp_table limit 1, 1");


Luis

-----Original Message-----
From: Artoo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] walking through database one record at a time with forms.


I'm tring to create a script for the WEBMASTER to go through a temporary
table in a MySQL database, and either accept or reject the data submitted by
users.

$sql = mysql_query("SELECT * FROM temp_table");
$result = mysql_num_rows($sql);

Then with,

while($row = mysql_fetch_array($sql))
{
...
...
}
I create variables and read the first record of the database, Then inside a
form the data of the record is displayed along with a ACCEPT and REJECT
buttons.

How do I have the script stop after displaying the first record and wait
until the ACCEPT or REJECT button has been pressed before displaying the
next record? Right now the script just continues and displays all the forms
in one long page, rather then haveing the execution pause until the
ACCEPT/REJECT button beeing pressed.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to