note 108375 added to function.mysql-select-db

From: Date: Fri, 20 Apr 2012 14:11:44 +0000
Subject: note 108375 added to function.mysql-select-db
Groups: php.notes 
Request: Send a blank email to php-notes+get-187261@lists.php.net to get a copy of this message
Note that the manual is slightly misleading it states :- "Sets the current active database on the server that's associated with the specified link identifier. Every subsequent call to mysql_query() will be made on the active database." The 2nd statement is not true or at best unclear. mysql_query() manual entry actually correctly states it will use the last link opened by mysql_connect() by default. Thus if you have 2 connections you will need to specify the connection when calling mysql_query or issue the connect again to ensure the 1st database becomes the default, simply using mysql_select_db will not make the 1st database the default for subsequent calls to mysql_query. Its probably only apparent when the two databases are on different servers. ---- Server IP: 69.147.83.197 Probable Submitter: 77.86.78.105 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-select-db.php Edit -- https://master.php.net/note/edit/108375 Del: integrated -- https://master.php.net/note/delete/108375/integrated Del: useless -- https://master.php.net/note/delete/108375/useless Del: bad code -- https://master.php.net/note/delete/108375/bad+code Del: spam -- https://master.php.net/note/delete/108375/spam Del: non-english -- https://master.php.net/note/delete/108375/non-english Del: in docs -- https://master.php.net/note/delete/108375/in+docs Del: other reasons-- https://master.php.net/note/delete/108375 Reject -- https://master.php.net/note/reject/108375 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#187261) next »