Print out the query, execute it in phpmyadmin, Or, simply add,
or die(mysql_error()); ie.,
// sent from form
$textbox_value = ($_POST['code']);
$checkbox = ($_POST['checkbox']);
foreach($checkbox as $tablename) {
$query = "INSERT INTO $tablename (code, time) VALUES ('$textbox_value', NOW())";
$result = mysql_query($query) or die(mysql_error());
if($result) {
echo("code added to $tablename database <br />");
}
else
echo "could not add code to $tablename database <br />";
}
?>
This will make the code to print the error message on the screen if there is any.
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
Offline 3,878 posts
since Nov 2007