On Sat, 1 Feb 2003 13:28:00 -0800 [EMAIL PROTECTED] (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:[EMAIL PROTECTED]
http://www.MyPhorum.de 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to