...

View Full Version : mysql_connect in php, when to?



titansolaris
10-24-2004, 04:46 AM
Hello! I was wondering, do we need to type in

$convar=@mysql_connect('localhost','username','password');
if (!$convar){die('<p>it died...<p>');}

everytime we want to display something out of the database to the user?

raf
10-24-2004, 09:26 AM
no. you only need to open a connection once for each script. It remains open during scriptexecution and is then automatically closed.

titansolaris
10-24-2004, 09:45 AM
Thanks a lot man.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum