error in sql statement stops execution
Posted: Thu Jan 09, 2003 10:12 am
All,
I am trying to process inside a loop a large amount of insert statements. This is not difficult, but if one of them fails due to a data problem causing a syntax error, the entire script stops executing. I dont want that, I want to log the bad statement and continue execution....
something like a try-catch block. This is what I am doing now....
So even with the or die it stops...is there any other kind of error handling or a setting in PHP.INI that would make it continue?
I am trying to process inside a loop a large amount of insert statements. This is not difficult, but if one of them fails due to a data problem causing a syntax error, the entire script stops executing. I dont want that, I want to log the bad statement and continue execution....
something like a try-catch block. This is what I am doing now....
Code: Select all
odbc_exec ( $db, $sqlstm) or die ("ERROR MESSAGE OR LOGGING FUNCTION")