MySQL is a database that goes hand-in-hand with PHP.
This is for People here who dont know how to connect to MySQL.
You will need it in many PHP development situations.
Hope this was helpfulPHP Code:<?php
$dbserver = "localhost";
//if you do not know your database server then try localhost
//You can find information of your mysql database at the PhpMyAdmin Panel
$dbusername = "dbusername";
$dbname = "dbname";
$dbpass = "dbpassword";
$connect = mysql_connect($dbserver,$dbusername,$dbpass); //Connects
$selectdb = mysql_select_db($dbname); \\Selects desired DataBase
if(!$connect || !$selectdb){ //If one or both of the mysql functions fail
die("Cannot connect: " . mysql_error()); //Display error
}
else{ //If no errors occur
echo "You have connected to a database!";
}
?>
HTML portion of webpage that uses MySQL data
<?php mysql_close(); //disconnect ?>




Reply With Quote