PHP/MYSQL Connection Problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Okanogan
Forum Newbie
Posts: 9
Joined: Sun Aug 10, 2003 2:59 pm

Post by Okanogan »

I am not sure at this about the brackets.

I got it working with this:

// MYSQL CONNECT STRINGS
$db_user = 'aplus';
$db_password = 'password';
$db_database = 'aplus';
$db_server = 'localhost';
$db_table = 'table';

//CONNECT TO MYSQL
$db_conn = mysql_connect($db_server, $db_user, $db_password) or die(mysql_error());
print ("Connected successfully");


and I think it can even go like this with the double quotes.

$db_conn = mysql_connect("localhost", "mysql_user", "mysql_password")
or die("Could not connect: " . mysql_error());


I was just a bit confused trying to connect to one of the tables in the datbase.
Post Reply