note 124662 added to function.odbc-connect

From: Date: Wed, 29 Jan 2020 19:38:00 +0000
Subject: note 124662 added to function.odbc-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-213975@lists.php.net to get a copy of this message
One additional note regarding odbc_pconnect and possibly other variations of pconnect: If the connection encounters an error (bad SQL, incorrect request, etc), that error will return with be present in odbc_errormsg for every subsequent action on that connection, even if subsequent actions don't cause another error. For example: A script connects with odbc_pconnect. The connection is created on it's first use. The script calls a query "Select * FROM Table1". Table1 doesn't exist and odbc_errormsg contains that error. Later(days, perhaps), a different script is called using the same parameters to odbc_pconnect. The connection already exists, so it is reused. The script calls a query "Select * FROM Table0". The query runs fine, but odbc_errormsg still returns the error about Table1 not existing. I'm not seeing a way to clear that error using odbc_ functions, so keep your eyes open for this gotcha or use odbc_connect instead. ---- Server IP: 45.112.84.4 Probable Submitter: 38.142.137.34 (proxied: 24.255.119.210) ---- Manual Page -- http://php.net/manual/en/function.odbc-connect.php Edit -- https://master.php.net/note/edit/124662 Del: integrated -- https://master.php.net/note/delete/124662/integrated Del: useless -- https://master.php.net/note/delete/124662/useless Del: bad code -- https://master.php.net/note/delete/124662/bad+code Del: spam -- https://master.php.net/note/delete/124662/spam Del: non-english -- https://master.php.net/note/delete/124662/non-english Del: in docs -- https://master.php.net/note/delete/124662/in+docs Del: other reasons-- https://master.php.net/note/delete/124662 Reject -- https://master.php.net/note/reject/124662 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#213975) next »