PHP Classes

File: fwphp/glomodul/blog_akram/Include/DB_mysql.php

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/blog_akram/Include/DB_mysql.php   Download  
File: fwphp/glomodul/blog_akram/Include/DB_mysql.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 1 year ago
Size: 483 bytes
 

Contents

Class file image Download
<?php

   
try {
       
$host = "localhost";
       
$dbname = "z_phpcms"; // z_blogcms z_cleanblog
       
$user = "root";
       
$pass = "";

       
$conn = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
       
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch(
PDOException $e) {
        echo
$e->getMessage();
    }
   

   
// if($conn == true) {
    // echo "conn works fine";
    // } else {
    // echo "conn err";
    // }