I'm using PHP3 with Apache on a NT box serving about 30 people. The datasource is an Access DB with ODBC links all set up.
My problem is that occasionally a call to odbc_exec will fail even though the SQL statement is completely valid ( I mail the offending sql statement to myself when an error occurs ). This only happens occasionally and it doesn't occur on the same page or the same sql statement.
My question is if there is a function which will give me the reason the odbc_exec failed. This way I could have the email to me include the error msg. I am attempting to get access to the error log from the system administrator to see if there is any indicators there but it looks like that may not be happening.
I'm currently using the following type of methodology:
if ($result = odbc_exec($conn, $sqlstr))
{
while (odbc_fetch_row($result))
{
//list the row
.
.
}
}
else
{
//send me an email
}
Any help would be great.