I already have the mysql database made, I just need to connect php to mysql locally but I don't know the php commands for that.
cheers
I already have the mysql database made, I just need to connect php to mysql locally but I don't know the php commands for that.
cheers
The following contains a pretty good example: http://ca3.php.net/manual/en/mysql.examples-basic.php
Search for some tutorials on the subject. Here is one:
http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/connect-to-mysql-database.aspx
$server = 'localhost';
$user = 'myUser';
$pass = 'myPass';
$dbname = 'MyDatabase';
$con = mysql_connect($server, $user, $pass) or die("Can't connect");
mysql_select_db($dbname);
This is a simple connect to the mysql server. After Connecting to the server it selects a DB
<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>