Re: Possible PHP/MySQL Bug?
| From: | Thomas Seifert | Date: | Sat, 01 Feb 2003 21:44:45 +0000 |
| Subject: | Re: Possible PHP/MySQL Bug? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133920@lists.php.net to get a copy of this message | ||
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