php mysql connection help..
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 articles about how to connect 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...
Subject
Written By
Posted
php mysql connection help..
June 04, 2005 01:50PM
September 11, 2007 04:32AM
September 11, 2007 05:52AM
September 12, 2007 01:24AM
November 07, 2007 01:47AM
September 12, 2007 04:57AM
November 10, 2006 09:50PM
November 10, 2006 10:22PM
December 22, 2006 12:10AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.