![]()
![]()
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:
<?php
$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.");
mysql_select_db("$db", $conn);
?>
After get it connected, then you can operate it as much as you want.
I’ll teach you in advance on next posts.





September 18, 2007 at 5:45 am
bro! bisa jelasin cara installation mysql base windows, pemakaiannya bukan untuk server (buat latihan aja).
thank’s
September 18, 2007 at 9:51 am
kenapa ga pake XAMPP aja? lebih gampang kok buat belajar, malah sekalian ada interpreter buat PHP, jadi bisa sekalian belajar PHP juga.
September 19, 2007 at 2:30 pm
thank’ s infonya, ternyata XAMPP udah komplit
September 19, 2007 at 3:17 pm
sami-sami…