where do i put the name of my database

Discussion in 'PHP' started by jbzcc, Sep 12, 2008.

  1. #1
    Hi all please need your help on the code below.
    where do i put the name of my database.
    I see where to put the user name and pw but i am not sure of where to put the name of the database,. thanks



    <?php
    $db = mysql_connect("localhost", "username", "password") or die("Could not connect.");
    if(!$db)
    die("no db");
    if(!mysql_select_db("database_password",$db))
    die("No database selected.");
     
    jbzcc, Sep 12, 2008 IP
  2. allaboutgeo

    allaboutgeo Peon

    Messages:
    85
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Replace database_password with the database name
    if(!mysql_select_db("database_password",$db)) die("No database selected.");
     
    allaboutgeo, Sep 12, 2008 IP
  3. jbzcc

    jbzcc Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks
    it worked now
    I appreciate
     
    jbzcc, Sep 12, 2008 IP