Re: [Phplib-users] Access denied, 2 databases, extrange error
Brought to you by:
nhruby,
richardarcher
|
From: <wo...@sw...> - 2002-07-31 12:10:59
|
I ran into a similar problem a while back an made a permanent fix to
the code to solve this. The changes are simple and benign and located
in db_mysql.inc. I have posted this before and request that the
changes get migrated into CVS, but I don't think it ever happened.
Here is a diff of the orginal file and my changes:
[woodbri@linus php]$ 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);
---
> $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);
HTH,
-Steve
On 31 Jul 2002 at 12:39, Donncha O Caoimh wrote:
> This has been a bug that plagued me several times in the past. To fix it just
> make sure that each database connection has a different user.
>
> Donncha.
>
> On Wednesday 31 July 2002 12:33, 3s wrote:
> > Hi,
> >
> > my first message to the list.
> >
> > I was using for 3 years ago DB classes from PHPLIB without problems,
> > until now.
> >
> > Normally we use the library with one database only, but in one of my
> > projects I need to connect to different databases (MySql), with different
> > servers and different users. Only in one point the system is showing me
> > the error, in other places works ok, but suspect that I have good look
> > and I doing something wrong.
> >
> > In the browser after the last </html> label shows the following error:
> >
> > Access denied for user: 'pro...@21...' to
> > database 'portal'
> >
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Dice - The leading online job board
> for high-tech professionals. Search and apply for tech jobs today!
> http://seeker.dice.com/seeker.epl?rel_code1
> _______________________________________________
> Phplib-users mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phplib-users
>
|