Re: Status of mysql_db_query()

From: Date: Sat, 07 Sep 2002 15:07:13 +0000
Subject: Re: Status of mysql_db_query()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-88031@lists.php.net to get a copy of this message
On Sat, 7 Sep 2002, Georg Richter wrote: GR>>> GR>>> On Friday 06 September 2002 19:17, Melvyn Sopacua wrote: GR>>> > On Fri, 6 Sep 2002, Georg Richter wrote: GR>>> GR>>> > GR>>> > One can do it, with an extra query "SELECT DATABASE()". GR>>> > GR>>> 1) Its not a good idea, to move SQL queries into the extension instead of GR>>> using api-calls. That should be the job of userland functions. GR>>> GR>>> 2) In case you have an syntax error in your SQL-Statement, its not possible GR>>> to determine the error via mysql_error or mysql_errno cause the mysql_error GR>>> functions always return the error from the last command, which is not GR>>> mysql_real_query but mysql_select_db. Yep. Didn't think of that. Would it then be an idea, to wrap mysql_select_db in php_mysql_select_db and use a global (or function with a static var, like active_db([string newdb])), to store the 'current db'? Or would you say, that your previous example is really a userland issue and docu- mentation should provide some examples? GR>>> GR>>> Regards GR>>> GR>>> Georg GR>>> -- Melvyn.

« previous php.dev (#88031) next »