Re: Possible PHP/MySQL Bug?

From: Date: Sat, 01 Feb 2003 21:46:50 +0000
Subject: Re: Possible PHP/MySQL Bug?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-133922@lists.php.net to get a copy of this message
Thomas, I changed it so that the two connections use different username/password combination, and everything went smoothly. Thank you very much for your rapid response. Tim "Thomas Seifert" <thomas.seifert@myphorum.de> wrote in message news:20030201224445.77ff37c3.thomas.seifert@myphorum.de... On Sat, 1 Feb 2003 13:28:00 -0800 timothybug@yahoo.com (Tim Lan) wrote: > The following code is supposed to migrate data from an old database to a new > one, but produces the error: > > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > resource in C:\...\convertdb.php on line 17 > > The code: > > <?php > > /* connect to database */ > if(!($srcDB = mysql_pconnect('localhost', 'root')) || > !mysql_select_db('temp', $srcDB)) { > echo 'Unable to connect to source database'; > exit; > } > > if(!($desDB = mysql_pconnect('localhost', 'root')) || > !mysql_select_db('cgu', $desDB)) { > echo 'Unable to connect to destination database'; > exit; > } > ah yes and another thing. you can't work on two databases with the same connection parameters (host, username,password) to have different connection-ids. PHP only keeps one connection and not two with the same parameters. They are the same connection for php which is expected behaviour there (although I don't like it too). Regards, -- Thomas Seifert mailto:thomas.seifert@myphorum.de http://www.MyPhorum.de

« previous php.general (#133922) next »