PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
Frogger
Worker
Worker


Joined: Oct 06, 2003
Posts: 108

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

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");
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: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum