Connect Mysql and PHP

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

Connect Mysql and PHP
  1. Unread #1 - Aug 16, 2009 at 9:06 PM
  2. Raid500
    Joined:
    Feb 11, 2007
    Posts:
    592
    Referrals:
    1
    Sythe Gold:
    0

    Raid500 Forum Addict

    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 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site