public function count($table, $array = null) {
if($array == null){
$sql = "SELECT count(*) from " . $table;
}else{
$columns = array_keys($array);
$values = array_values($array);
$sqlString = "";
for($i=0;$i if($i==count($columns)-1){
$sqlString .= $columns[$i]." = '".$values[$i]."' ";
}else{
$sqlString .= $columns[$i]." = '".$values[$i]."' and ";
}
}
$sql = "SELECT count(*) from " . $table. " WHERE ". $sqlString;
}
$count = $this->connection->prepare($sql);
$count->execute();
return $count->fetchColumn();
}
Düzgün Çalışmıyor hatayı bulabilir misiniz?