PHP is most popular server-side web programming in the planet.
According to NetCraft’s surveys, there are more than 20 million domains hosted on web hosting services with PHP support.
The ‘true love’ of PHP is MySQL. MySQL is database engine used by PHP to store many of information in our dynamic pages.
But, how’s the way to connecting this couple? Here we go:
$host = "localhost"; //default name for host name. Change is may not necessary
$user = "dbuser"; //your MySQL database username
$pass = "dbpass"; //your MySQL database password
$db = "dbname"; //your MySQL database name$conn = mysql_connect("$host", "$user", "$pass") or die ("Unable to connect to database.");
After get it connected, then you can operate it as much as you want.
I’ll teach you in advance on next posts.