Hiya.. I have a query for my projects insert, that works fantastical for what I need it to do. But when I run the same type of query for my users table, I get an error message of :
"Error, insert query failedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('popeye', 'bluto', '2006-01-01')' at line 1"
I am using bogus information in the user and password and date fields, but the format should be ok. here is the working code from the projects query:
<?php
include "db_config.php";
mysql_select_db(iceregen_MStudio);
$query = "INSERT INTO projects (UserID, ProjDesc, file, OrigProj, OrigUser, ProjDate) VALUES ('3', '$ProjDesc', '$File', '3', '4', '2005-01-01')";
mysql_query($query) or die('Error, insert query failed'.mysql_error());
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed'.mysql_error());
?>
This is the results that this code produces:
Author Project Name Original Project Original Author Project Date
3 ".craigs1a.mid ." 3 4 2005-01-01
Now, here is the non-working code from the user's query:
<?php
include "db_config.php";
mysql_select_db(iceregen_MStudio);
$query = "INSERT INTO users (UserName, password, datejoin,) VALUES ('popeye', 'bluto', '2006-01-01')";
mysql_query($query) or die('Error, insert query failed '.mysql_error());
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed '.mysql_error());
?>
There is a numeric autoincrememnting field in front of both of these php tables, and the projects one seems to work fine.
The error code doesnt make it clear to me what is wrong in the user insert code. Can someone lead the blind to the error?
Thank you;
Ice