|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-07 22:24 UTC] sniper@php.net
[2002-08-08 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 17:00:02 2025 UTC |
I'm using a class for my database queries. In my code I am querying two different databases with different usernames and passwords (I am aware an existing problem that occurs when the usernames and passwords are the same). For some reason, often under heavy load, mysql_query queries the wrong database (looks for table in wrongdatabase.table), even though the connection_id and database are correct, and even though I force it to select the database again (also happens when the mysql_select_db line is commented out). function sql_query(&$sql_db, $query="") { // Constructor of the query object. // executes the query if(!empty($query) && !empty($sql_db->connect_id)){ $connectdb = mysql_select_db($sql_db->database, $sql_db->connect_id); // force it to select database $this->result=@mysql_query($query, $sql_db->connect_id) or die($this->error($query,$sql_db->connect_id,$sql_db->database)); return $this->result; } }