Troubles with Check Boxes -- Help needed :)
Posted: Tue Dec 02, 2003 12:20 pm
I am having trouble creating series of check boxes from an array that is built from an sql database. I need to take these check boxes and compair them to a second array to determine of they start off checked or unchecked.
This printed out one check box (insted of one checkbox for each item in the array). it also gave me a warning:
This produced 1 check box with a value of 5. There should be a second check box with a value of 6. Also both check boxes should load as being checked.
This printed out one check box (insted of one checkbox for each item in the array). it also gave me a warning:
Warning: mysql_data_seek(): supplied argument is not a valid MySQL result resource in /home/public_html/test.php on line 104
Code: Select all
<?php
while ( $row = mysql_fetch_array($filelist) ) {
$test_value = $row_filelist['ID'];
echo "<input name='selectedfile[]' type='checkbox' value='" . $test_value . "'";
while ( $row2 = mysql_fetch_array($FiletoPagelist) ) {
if ( $row2_FiletoPagelist['file'] == $test_value ) {
echo " checked>";
}
else {
echo ">";
}
}
mysql_data_seek ($FiletoPagelist['file'],0);
}
?>