please help me php issue.

Discussion in 'PHP' started by whiteblue1942, Apr 11, 2008.

  1. #1
    when i am trying to connect to my database how do i know what my username, password, and localhost are?
     
    whiteblue1942, Apr 11, 2008 IP
  2. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Where are you trying to connect, local or on your hositng? In the first case you should know the name and pw, otherwise the hosting provider whould tell you. You may also create databases in the cpanel of your host.
     
    cbn81, Apr 11, 2008 IP
  3. whiteblue1942

    whiteblue1942 Peon

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok now i got it but now it says i am using passwrod YES when i am not using that password, i am using the passwrod for my username, why is it telling me i am using the password YES?
     
    whiteblue1942, Apr 11, 2008 IP
  4. c4st

    c4st Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's telling you are using a password. The password isn't specifically 'YES', but yes you are using a password.
     
    c4st, Apr 11, 2008 IP
    whiteblue1942 likes this.
  5. jsmcm

    jsmcm Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    51
    #5
    Do you have the username, password and host (server address) now?

    Your PHP connection should look something like this:

    <?
    mysql_connect("your-server.com", "username", "password") or die("Could not connect to the database, please email the administrator. Err Reference: Adm_Adm_1");
    ?>

    You can't leave the password out unless you specifically set the database up that way, which I very much doubt if this is a shared hosting server.

    If you need more help, why not post the code snippet you are trying to use so someone can help you with that.
     
    jsmcm, Apr 12, 2008 IP