Help - Search - Members - Calendar
Full Version: Help I Dont Know How To Connect To Mysql
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
sayhaXXX
this is my codes

<?php
$host = "localhost";
$user = "root";
$password = "root";

$connection = mysql_connect($host,$user,$password)
or die("Could not connect: ".mysql_error());
?>
NaRzY
You need to change those values to those of your MySQL User/DB accounts. Try the source below with your correct info (I commented it so you can follow):
CODE
<?php
$host = "localhost"; //host name - usually localhost
$user = "root"; //database username
$password = "root"; //database user password

$connection = mysql_connect($host, $user, $password) or die("Could not connect: ".mysql_error()); //grab the MySQL defined strings and insert them. Print result
echo "Connect to MySQL"; //only display is successfully connected
?>

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.