jeromepelletier
02-08-2006, 07:58 PM
If i start a mydql connection and store some data as variables, can i open a new connection ? WIll the first connection close or how do i do dhtis
|
||||
php and mysqljeromepelletier 02-08-2006, 07:58 PM If i start a mydql connection and store some data as variables, can i open a new connection ? WIll the first connection close or how do i do dhtis marek_mar 02-08-2006, 08:25 PM No, you can have more than one connection at once. raf 02-08-2006, 09:40 PM if you use a standard textbook mysql_connect() without the new_link parameter set to True, then no new connection will be openend on your second (and following) mysql_connect() calls. this is also very sensible of php, because why would you need a second connection? during the scriptexecution, php will keep using the same connection and then close it automatically when the script is finished. this way, you avoid a lott of overhead because you don't need to keep opening and closing connections. Element 02-08-2006, 10:44 PM Why would you need more then one connection, can't you just use one and re-select a database? Never tried it so I'm not sure about that one lol. jeromepelletier 02-08-2006, 11:09 PM because i have 2 games, want 1 to relate to the other through a contest, so, i need to acces my toher databse to do so Kid Charming 02-08-2006, 11:20 PM As long as both db's are on the same server, you can use the same connection and switch between them with mysql_select_db(). You don't even have to do this, though, as you can determine the db you're using directly in the query: SELECT foo FROM databasename.tablename jeromepelletier 02-08-2006, 11:48 PM :) thanks |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum