how do i access database?

Discussion in 'MySQL' started by indyonline, Mar 29, 2008.

  1. #1
    Hello everyone.
    I'm trying to uplaod a game script i bought and i have to enter in my sql db access info. It says i need,
    <?php
    $user = 'enter here';
    $pass = 'enter here';
    $host = 'enter here';
    $db = 'enter here';
    @mysql_connect($host,$user,$pass);
    @mysql_select_db($db);?>

    Does anybody know how i can find the info that needs to go here? thanks.
     
    indyonline, Mar 29, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Where you are setting up this script? On you local machine or on web hosting account?

    If you are on local machine then use any MySQL GUI to create a database, mysql username and password and then give that mysql user rights to the newly created database.

    And if you are setting it up on web host, go to your web hosting control panel and then create database, username/password and then give rights as i said above.

    If your MySQL script is on the same server where the PHP is running, then use localhost for $host otherwise provide the IP.
     
    mwasif, Mar 29, 2008 IP
    indyonline likes this.
  3. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #3
    mwasif, Mar 29, 2008 IP
  4. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #4
    Thank you both for your input.
     
    indyonline, Mar 30, 2008 IP
  5. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #5
    You are welcome.
     
    mwasif, Mar 30, 2008 IP