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

JBRTaylor

Registered User.
Local time
Today, 12:27
Joined
Mar 4, 2012
Messages
14
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.

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

$TheHireID = odbc_exec($conn, $sqlIn);
echo $TheHireID;
</code>

Any Idea of any alternatives?

Thanks
Jon
 

Users who are viewing this thread

Top Bottom