I found that using odbc_close($odbchandle) on a connection opened by odbc_pconnect() causes a warning "not a valid ODBC-Link resource". So you can't just change odbc_connect() to odbc_pconnect() and expect things to work without warning messages. However, you can use odbc_close_all() and not get a warning.