View Single Post
Old 01-08-2005, 00:18   #24
Richard M
Inactive
 
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Re: PHP/SQL Help Please

Quote:
Originally Posted by Paul M
The format of mysql_connect() is this ;

PHP Code:
mysql_connect('server', 'user', 'password') 
You then use the mysql_select_db() statement to connect to your database.
Sorry, just to be annoying here.
The mysql_select_db() function actually does a "use <database>" command.
The mysql_connect() function does establish the connection in the first place.

You can probably test this by using this code:
PHP Code:
<?php
if(!mysql_connect('server', 'username', 'password') {
echo 
'I can\'t connect!';
exit;
}
else {
echo 
'Connected OK!';
}
?>
Richard M is offline   Reply With Quote