Re: General Mysql Connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Waynn Lue wrote:
>> With MySQL, you can change the DB from query to query with
>> mysql_select_db.  The alternative as I stated in my last post is to use
>> the fully qualified table name (database.table) in your query.  MySQL
>> doesn't care which DB you have open if you do that.  In both of these
>> cases, the same connection is used.
>>
>>     
>
> That brings me back to the original point, is there a performance decrease
> to continually calling mysql_select_db?  And shouldn't connections that are
> being made during the processing of a php script (which runs for no more
> than two seconds) be lasting at least until the end of the script, instead
> of getting errors like "Lost connection to server"?
>
>   
The only overhead of constantly using mysql_select_db is 2 function
calls to make a query instead of just using the database name in the
query.  However, this should not be that expensive.
Yes, connections should be available for the whole script if you don't
destroy them.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com




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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux