Page 1 of 1

For some reason my INSERT statement isn't working.

Posted: Sat Jul 12, 2003 2:53 pm
by jelco
Hi,
I just got my member's area working this morning and now I'm trying to get this form to add the info to my database, it should work fine because I just copied the text from another script and changed the variables. I probaly just have a typo in it but could someone please just give it a look over?

Code: Select all

<?PHP

$date = gmdate("l j")."<sup>".date("S")."</sup>".date(" F, Y");

$connection = mysql_connect("localhost", "[i]username[/i]", "[i]password[/i]");
$db = mysql_select_db("$database", $connection);
$query = "INSERT INTO reports (uname,block.hours,blocksweep,bds,currentevents,ressies,contacts,queries,date)".
  "VALUES ('$username', '$block', '$hours', '$sweep', '$bds', '$blockdoing', '$events', '$ressies', '$contacts', '$quieries')";
$result = mysql_query($query, $connection);

echo "Report Successfully Submitted";


?>

silly mistake

Posted: Sat Jul 12, 2003 4:36 pm
by phpScott
I can call it a silly mistake because I have done it on occasion.
You have a period instead of a comma between block.hours in your select statement where you list the fields.

phpScott

Posted: Sat Jul 12, 2003 5:40 pm
by jelco
Thankz, I thought it was a typo, just couldn't find it.