Database can't be fetch. HELP! :(

Discussion in 'Review My Site' started by studio1p, Feb 27, 2017.

  1. studio1p

    studio1p New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    <?php
    $mysql_hostname = "198.91.81.7";
    $mysql_user = "";
    $mysql_password = "";
    $mysql_database = "shoopingcart";
    $prefix = "";
    $bd = ($GLOBALS["___mysqli_ston"] = mysqli_connect($mysql_hostname, $mysql_user, $mysql_password)) or die("Could not connect database");
    ((bool)mysqli_query( $bd, "USE " . $mysql_database)) or die("Could not select database");
    ?>

    <?php
    //database connection
    try {
    $dbc = new PDO('mysql:host=198.91.81.7; dbname=shoopingcart', '', '');
    $dbc->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
    } catch(PDOException $e) {
    echo "Error: " . $e->getMessage();
    }
    ?>


    What's wrong with my codes?
     
  2. bdistler

    bdistler Well-Known Member Prime Account

    Messages:
    3,534
    Likes Received:
    195
    Trophy Points:
    63
    the following settings should be used:
    NOTE: Free hosting accounts do not have remote MySQL access.
     

Share This Page