Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9
Author Message
Frogger
Worker
Worker



Joined: Oct 06, 2003
Posts: 108

PostPosted: Sun Nov 30, 2003 12:33 pm Reply with quote

What is the proper, or better way to write the following code, as for some reason my attempts are failing.

Code:
if (!$link = mysql_connect("localhost", "DBUNAME", "DBPASS"))

    exit("Unable to make a connection to the database");
if (!mysql_select_db("DBNAME", $link))
    exit("Unable to select the database");

_________________
Image 
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger ICQ Number
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Nov 30, 2003 3:25 pm Reply with quote

Try
Code:
if (!mysql_connect("localhost", "DBUNAME", "DBPASS")) exit("Unable to make a connection to the database"); 

if (!mysql_select_db("DBNAME")) exit("Unable to select the database");
Unless you are making more than 1 connection, you don't really need the $link.
 
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©