Mysql PDO connection

Mysql PDO connection
<?php
$host = 'localhost';//Your database host name
 $dbname = 'Demo';// Your database name
 $username = 'root';//Your database user name
 $password ='';//Your database password

$con=new PDO("mysql:host=$host;dbname=$dbname",$username,$password);

if($con){
    echo "yes";
}else{
    echo "failed";
}

15 Replies to “Mysql PDO connection”

  1. I just want to tell you that I am just newbie to blogging and site-building and certainly liked this web site. Almost certainly I’m want to bookmark your blog . You definitely have exceptional well written articles. Appreciate it for sharing your blog site.

  2. I simply want to say I am just newbie to blogs and seriously savored your web-site. Very likely I’m planning to bookmark your blog . You really have great stories. Many thanks for sharing your blog.

  3. I just want to say I am just newbie to blogging and site-building and honestly liked this web page. Almost certainly I’m likely to bookmark your blog . You amazingly have impressive articles and reviews. With thanks for sharing with us your webpage.

Leave a Reply

Your email address will not be published. Required fields are marked *