i recently installed php and mysql
I'm a newbie to this so I don't know much
how do I connect mysql database in php code?
i read on php.net and I do not understand it..
<?php
$link = mysql_connect('mysql_server', 'mysql_username', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
now I do this on my localhost and the port is 3306
so I suppose that I replace mysql_server with localhost:3306?
I don't know what the username is...when I install mysql there wasn't a username...
whenever I access mysql using mysql.exe, I use the password 12345
so is it that I replace mysql_password with 12345?
please help...this is the first step and I'm stuck...
I'm a newbie to this so I don't know much
how do I connect mysql database in php code?
i read on php.net and I do not understand it..
<?php
$link = mysql_connect('mysql_server', 'mysql_username', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
now I do this on my localhost and the port is 3306
so I suppose that I replace mysql_server with localhost:3306?
I don't know what the username is...when I install mysql there wasn't a username...
whenever I access mysql using mysql.exe, I use the password 12345
so is it that I replace mysql_password with 12345?
please help...this is the first step and I'm stuck...
