<?php
$db_name = 'mysql:dbname='.DB_NAME.';host='.DB_HOST;
$options = array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
);
$con = new PDO($db_name, DB_USER, DB_PASSWORD,$options);
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$con->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$prepare = "SELECT * FROM users WHERE id = :id ";
$bind_arr = array(":id" => 1);
$stmt = $con->prepare($prepare);
$stmt->execute($bind_arr);
$row_count = $stmt->rowCount();
if($row_count>0){
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);