code does not update record.
error report … "Could not insert record: You have an error in your SQL syntax
I suspect the syntax is wrong at $hours … but don’t have solution. print $hours responds properly, reporting the contents of $hours.
Thanks in advance for any help you might offer.
A.
[php]<?php
$hours = ‘’;
if(is_array($_POST[‘hour’])) foreach($_POST[‘hour’] as $key=>$val){
$hours.= $val;
}
print ($hours);
//connect to database successful
//+++++++++++++++++++++++++++++++++++ INSERT RECORD
$query = mysql_query(“INSERT INTO members VALUES(’’,‘David’, ‘$hours’”);
if (!$query) {
echo 'Could not insert record: ’ . mysql_error();
echo $query;
exit;
}
else
{
echo “record inserted”;
}
?>
[/php]