Step 1: google "odbc error s1000". Which in this case isn't very helpful.
Step 2: Read php doc and make your code check the results of its function calls
http://se.php.net/manual/en/function.odbc-connect.php which tells you to
if ($connection) {
}
else {
# connction error
}
And where it says #connection error, make use of error and error message.
http://se.php.net/manual/en/function.odbc-exec.php tells you to
$result = odbc_exec(...);
if ($result) {
}
else {
# error
}
If you do not need the result, and really wish to die on exec error, your way works. But including the error message (see above) is a really really good idea. Especially for an error which according to the ODBC error list found from googling states that S1000 can be returned from
All ODBC functions except:SQLAllocEnv
SQLError
http://se.php.net/manual/en/function.odbc-close.php tells you that this is bad
odbc_close(false);
Which you know, from documentation on odbc_connect (first link), is returned on connect error. So only call close if connect was successful.