note 60649 added to function.mysql-connect
| From: | shaneatjavartiidotcom at osu1 dot php dot net | Date: | Fri, 13 Jan 2006 01:46:07 +0000 |
| Subject: | note 60649 added to function.mysql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101673@lists.php.net to get a copy of this message | ||
In addition to the comments made by baldurien at club-internet dot fr it's really important to
specify which resource id to use in queries when connecting to two or more databases at once.
A lot of my code was using
mysql_select_db($database_Name, $resource_ID);
$result = mysql_query($query);
When using one database only this presents no problem. When using two different connections from two
different servers everything needs to sepcify which resource to use.
$result = mysql_query($query, $resource_ID);
Although this is probably stating the obvious to old hands it's definately a trap to new
players (and lazy coders like me)
----
Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60649
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60649&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60649&report=yes
Search -- http://master.php.net/manage/user-notes.php