PHP Classes

File: config.php

Recommend this page to a friend!
  Classes of anas khan   Custom PHP URL Shortener using PDO   config.php   Download  
File: config.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Custom PHP URL Shortener using PDO
Create and expand short URLs in a custom domain
Author: By
Last change:
Date: 2 years ago
Size: 303 bytes
 

Contents

Class file image Download
<?php

//db config

$dbHost = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "test";

//create db connection

try{
   
$db = new PDO("mysql:host=$dbHost;dbname=$dbName", $dbUsername, $dbPassword);
}catch(
PDOException $e){
    echo
"Connection failed: " . $e->getMessage();
}


?>