Adblock breaks this site

Connect Mysql and PHP

Discussion in 'Archives' started by Raid500, Aug 16, 2009.

  1. Raid500

    Raid500 Forum Addict

    Joined:
    Feb 11, 2007
    Posts:
    592
    Referrals:
    1
    Sythe Gold:
    0
    Connect Mysql and PHP

    How to connect php with a mysql database

    Code:
    <?php
    $host = 'localhost'; //127.0.0.1 or 0.0.0.0 (Connects to your computer)
    $user = 'root'; //username of the db
    $pass = 'password'; //pass to db
    $databaseconnection = mysql_connect($host, $user, $pass) //the connection
    ?>
    The first line of code is the php tag.
    The second line of code is the ip or the mysql database
    The third line of code is the username for the mysql database
    The fourth line of code is the password
    The fifth line is the actually connection to the database
    The sixth line is the end php tag

    Raid
     
< my vouches | [PHP] $_GET and $_POST >


 
 
Adblock breaks this site