Matt,
Assuming that you have a variable number of records being displayed out of
the database:
As you write out the HTML, give each checkbox a name containing the ID# of
the record that is being written out. Ex:
<input type="check" name="chkAuthStatus_1203" checked>
<input type="check" name="chkAuthStatus_1204" checked>
<input type="check" name="chkAuthStatus_1205" checked>
Use code like the following to Write and Read the web form...
<?php
//Get the DB result
$dbResult = mysql_query("SELECT id, authstatus, whatever, whatever2 FROM
table WHERE whatever");
//Get the row count
$nRowCount = mysql_num_rows($dbResult);
//Scan the result
for($i=0; $i<$nRowCount; $i++)
{
//Get the current row as an object
$oRow = mysql_fetch_object($dbResult);
//Format the checkbox name
$sCheckName = "chkAuthStatus_" . $oRow->id;
//When Writing out the Web Form, use this
$sChecked = ($oRow->authstatus ? ' checked' : '');
echo "<input type=\"check\" name=\"$sCheckName\"$sChecked>";
//When Reading in the web form, use this
//If the checkbox variable isset(checked) then set the
authstatus=1
//Otherwise set the authstat= 0
$authstatus = (isset($$sCheckName) ? 1 : 0);
//Update the database
mysql_query("UPDATE table SET authstatus=$authstatus WHERE
id=$oRow->id");
}
?>
-Jason Garber
www.IonZoft.com
At 03:22 AM 10/3/2001 +0100, Matt C wrote:
>I have a page of jobs with AuthStatus set to 0. Basically I want to list
>each job title with a checkbox next to it. This I have done.
>
>What I really don't understand is how do I make it so that the rows in my
>table for all the different records when ticked are updated to 1?
>
>Please help.
>
>Matt
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]