User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,713 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,210 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums

PHP Form, SQL connectivity issues, please help.

Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: PHP Form, SQL connectivity issues, please help.

  #2  
Jun 15th, 2005
You have to indicate/select the database before the query is placed
[php]$dbhost = "hostname";
$dbuser = "dbuser";
$dbpass = "dbpwd";
$database = "dbname";

$sqlConn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Unable to connect!");
mysql_select_db($database) or die ("Unable to open database!");[/php]
The digit after the hostname is not necessary.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
All times are GMT -4. The time now is 12:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC