I am using the following PHP code to add a record to an MS Access database on Apache:
//Add new record to Access database
$update_query2 = "INSERT TrialNewsletters (EMAIL, FirstName, SentDate)
VALUES ('$tmember_email','$tmember_name','$senddate_format');";
$update_result2 = odbc_exec($conn, $update_query2);
$update_array = odbc_fetch_array($update_result2);
Unfortunately, I get the following errors:
Error 1: "Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in c:\phpdev\www\html\email_marketing\trialupdate.php on line 147"
Error 2: "Fatal error: Call to undefined function: odbc_fetch_array() in c:\phpdev\www\html\email_marketing\trialupdate.php on line 148"
Line 147 is the query. I am pulling my hairs out trying to figure out what the problem is. I have checked the PHP documentation, which has been no great help. I also have done various searches in newsgroups, but all the suggestions I have found are things I have already done (i.e., verifying that the table name is part of the query, verifying that the table name and columns have been spelled correctly, placing variables representing non-numeric data within quotes, etc...)
I really need to find a fix to this. Any help? Please! (Have mercy...) 🙁
Thanks!