[Phplib-trackers] [ phplib-Bugs-450642 ] db_mysql.inc loses database
Brought to you by:
nhruby,
richardarcher
From: <no...@so...> - 2001-08-13 22:48:14
|
Bugs item #450642, was opened at 2001-08-13 15:48 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450642&group_id=31885 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Richard Archer (richardarcher) Assigned to: Nobody/Anonymous (nobody) Summary: db_mysql.inc loses database Initial Comment: Nathan's bug report from the NetUSE bugs forum. Sorry about the whacked formatting... it didn't copy/paste well.-- Problem: When using phplib with mysql, phplib sets the default database. If the application uses another database, then phplib fails on page_close(); Fix: the following diff db_mysql.inc.new db_mysql.inc.old show the changes that allow phplib to access the database defined in local.inc independently of what the application uses for a database. This problem probably on show up if the user/pass is the same on both databases because mysql reuses the connection handle. This fix avoids the problem. diff db_mysql.inc db_mysql.inc.save 80,83c80,83 < # if (!@mysql_select_db($Database,$this->Link_ID)) { < # $this->halt("cannot use database ".$this->Database); < # return 0; < # } --- > if (!@mysql_select_db($Database,$this->Link_ID)) { > $this->halt("cannot use database ".$this->Database); > return 0; > } 117c117 < $this->Query_ID = @mysql_db_query($this->Database, $Query_String,$this->Link_ID); --- > $this->Query_ID = @mysql_query($Query_String,$this->Link_ID); 185c185 < $res = @mysql_db_query($this->Database, $query, $this->Link_ID); --- > $res = @mysql_query($query, $this->Link_ID); 196c196 < $res = @mysql_query("unlock tables", $this->Link_ID); # unrelated fix --- > $res = @mysql_query("unlock tables"); 244c244 < $id = @mysql_db_query($this->Database, $q, $this->Link_ID); --- > $id = @mysql_query($q, $this->Link_ID); 254c254 < $id = @mysql_db_query($this->Database, $q, $this->Link_ID); --- > $id = @mysql_query($q, $this->Link_ID); 263c263 < $id = @mysql_db_query($this->Database, $q, $this->Link_ID); --- > $id = @mysql_query($q, $this->Link_ID); ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450642&group_id=31885 |