$SQL_Exec_String = "Insert Into Person ( PersonID, Title, FamilyName, GivenName, PreferredName, Password, DateOfBirth, Mobile, DateExpired, FirstJoined) Values ( $PersonID, '$_POST[Title]', '$_POST[Surname]', '$_POST[FirstName]', '$_POST[Preferred]', '$_POST[Password]','$_POST[BirthDate]', '$_POST[Mobile]', date()+(365*5) , date())";
works perfectly in another file
$SQL_Exec_String = "Insert Into BookSpec ( PostedBy, BookSpecID, CourseCode, Author, Title, Price, Edition, DateListed, Hardcover, Bought) Values (".$_SESSION['ID'].", $BookSpecID, '$_POST[CourseCode]', '$_POST[Author]', '$_POST[Title]', '$_POST[Price]', '$_POST[Edition]', now(), '$_POST[hardcover]', 'No')";
works perfectly in another file
Those two work perfectly although I believe they shouldn't
u'll note one uses date() and one uses now() not that it really matters
$SQL_Exec_String = "INSERT INTO Invoice (CustomerID, Date, StatementNo, BookID) VALUES (".$_SESSION['ID'].",now(), $StatementNo, ".$_SESSION['BookID'].")";
echo $SQL_Exec_String;
wont work
$SQL_Exec_String = "INSERT INTO Invoice (CustomerID, Date, StatementNo, BookID) VALUES (".$_SESSION['ID'].",date(), $StatementNo, ".$_SESSION['BookID'].")";
echo $SQL_Exec_String;
wont work
although those two are formatted correctly, well according to the first two working files
so I look the date function up
add
$today=date("d/m/y");
or
$today=date("d/m/y g:i");
or
$today=date("d/m/y g:i a");
for date
$SQL_Exec_String = "INSERT INTO Invoice (CustomerID, Date, StatementNo, BookID) VALUES (".$_SESSION['ID'].",$today, $StatementNo, ".$_SESSION['BookID'].")";
echo $SQL_Exec_String;
no matter which one I use, it still gives me a syntax error, I'm connecting to ms access thru odbc and the field is date/time
anyone have any ideas?