Connecting PHP into MySQL

Posted: April 15, 2009 in PHP, Programming
Tags: ,

images

It is very simple :

    

<?php
        $host = "my_host";
        $user = "my_username";
        $pass = "my_password";
        $database = "my_database_name";

        mysql_connect($host, $user, $pass) or die ("sorry...connection failed");
        mysql_select_db($database);
?>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s