Here is the form code:
Code: Select all
<input name="selectedfile[]" type="checkbox" value="<?php echo $row_filelist['ID']; ?>">Code: Select all
<?php
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "addfiles")) {
for( $i = 0; $i < sizeof( $selectedfile ); $i++ ){
$insertSQL = sprintf("INSERT INTO filetopage (page, file) VALUES (%s, %s)",
GetSQLValueString($HTTP_POST_VARS['deletedpageid'], "int"),
GetSQLValueString($HTTP_POST_VARS['selectedfile[$i]'], "int"));
mysql_select_db($database_cms, $cms);
$Result1 = mysql_query($insertSQL, $cms) or die(mysql_error());
}
}
?>I do not understand why it gives this error. I tested it prior to adding the database info, by having it echo the results of the array, and it worked perfectly. It showed me all the values stored in the array.Column 'file' cannot be null
Any ideas?
Thanks