Thread: Web Server

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    123
    Rep Power
    0

    Web Server


    What I put in server from WEB server because I am first time uploading a website with php connection stuff. So I am stuck here that what should I place in server so that it worked online over web server.


    Code:
    $server = "";
    $username = "notes";
    $password = "";
    
    try{
    $conn = new PDO("mysql:host=$server", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      echo "connection successful";
    }
    
    catch (PDOException $e){
      echo "connection failed: ". $e->getMessage();
    }
    
    
    
    ?>
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,455
    Rep Power
    9645
    You have to find the information from your hosting provider. Assuming they provide a database, they will also tell you what hostname to use and also what username and password to connect with (if you don't set them yourself).

IMN logo majestic logo threadwatch logo seochat tools logo