Return ID of row inserted from php via ODBC access 2003 (1 Viewer)


Registered User.
Local time
Yesterday, 23:27
Mar 4, 2012
After uploading my access database to ms sql i have found what i think to be a better option for me which is to use ODBC to connect to the access 2003 database file from a php web page.

I have run into a problem with a sql string which uses OUTPUT to assign the record ID to a variable. The code below works fine in MS SQL but will not work using the ODBC connection.

If i remove the OUTPUT Inserted.HireID part i is ok with ODBC.

$sqlIn = "INSERT INTO tblQuote ([QuoteRequestedBy], [MailQuote], [ProdName]) OUTPUT Inserted.HireID VALUES ($Name,$mail,$ProdName)";

$TheHireID = odbc_exec($conn, $sqlIn);
echo $TheHireID;

Any Idea of any alternatives?


Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom