Problem With databases and Advanced Poll Script

Discussion in 'MySQL' started by Skinny, Mar 2, 2006.

  1. #1
    Hey,

    I'm trying to implement a php advanced poll script on my blog.

    This is the code it said to place on the blog:

    However, when I stick that in I get a wonderful error message:

    Now it seems that it doesn't know which database to select. It should be using adpo1, though I have two others.

    Now how do I include that in the code so my blog doesn't explode?

    Thanks,

    Skinny
     
    Skinny, Mar 2, 2006 IP
  2. Skinny

    Skinny Peon

    Messages:
    1,864
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anyone familiar with this. The database's name is actually gazotto_adpo1.

    Thanks

    Skinny
     
    Skinny, Mar 3, 2006 IP
  3. Andrewaclt

    Andrewaclt Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What is booth.php? You may have to specify the db in that file...or at least edit a string...
     
    Andrewaclt, Mar 4, 2006 IP
  4. Skinny

    Skinny Peon

    Messages:
    1,864
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Okay,

    Yes I have to specify the db, but I don't know how to do that. Can sombody help.

    Skinny
     
    Skinny, Mar 5, 2006 IP
  5. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Try this before the connection is required:

    $connection =MYSQL_CONNECT("db-location","userame","password") OR DIE("Unable to connect to database");  
    
    @mysql_select_db("databasename") or die("Unable to select database");
    PHP:
     
    mad4, Mar 5, 2006 IP
  6. Skinny

    Skinny Peon

    Messages:
    1,864
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Would the db be vulnerable because the password is in the source code?

    Skinny
     
    Skinny, Mar 5, 2006 IP
  7. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The password is only in the php script - it will not show in the actual html code (provided your server can parse php).
     
    mad4, Mar 6, 2006 IP
  8. petarddd

    petarddd Peon

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Looks like there is a config file you need to find. Look around the files and see if there is anything that looks like a configuration file. There is probably a default detabase name that the script is looking for and unless you change the default value, the script will not know the name of your actual db...
     
    petarddd, Mar 7, 2006 IP