View Single Post
Old 07-09-2008, 11:45 AM   #10 (permalink)
Sabolin
Registered User
 
Join Date: May 2003
Posts: 313
+9 Internets
You don't even have to bother with a class or function. If you just put:
Quote:
$conn = mysqli_connect("blah", "blahblah", "meh", "mehmeh");
into the opendb.php, when you call require_once("opendb.php") it will open the connection. Turns 6 lines of code in your example into 2.

Now if you're going to be opening multiple concurrent connections to the same db for whatever reason, then your method is fine.
Sabolin is offline   Reply With Quote

 
Uberguilds Network