Parse error: syntax error, unexpected ':', expecting ')' in C:\xampp\htdocs\php\config\config.php on line 34

<?php
class DB{

var $dbhost="localhost";
var $username="root";
var $password="";
var $dbname="yep";
var $connect;

function __construct()
{
try{
$this->connect=new PDO("mysql:host=".$this->dbhost.";dbname=".$this->dbname.";charset=utf8",$this->username,$this->password);

}catch(PDOException $error){

echo $error->getMessage();
exit();
}
}

public function data($chart,$wherearea="",$wherevalue="",$ordeby="ORDER BY ID ASC",$limit="")
{
$this->connect->query("SET CHARACTER SET utf8");
$sql="SELECT * FROM".chart;
if(!empty($wherearea) && !empty($wherevalue))
{

$sql.=" ".$wherearea;
if(!empty($ordeby)){$sql.=" ".$ordeby;}
if(!empty($limit)){$sql.=" LIMIT ".$limit;}
$work=$this->connect->prepare($sql);
$end=$work->execute($wherevalue);
$data=$work->fetchAll(PDO: :FETCH_ASSOC);

}
else
{
if(!empty($ordeby)){$sql.=" ".$ordeby;}
if(!empty($limit)){$sql.=" LIMIT ".$limit;}
$data=$this->connect->query($sql, PDO: :FETCH_ASSOC);


}
if($data!=false && !empty($data))
{
$datas=array();
foreach($data as $informations)
(
$datas[]=$informations;
)
return $datas;

}
else
{

return false;

}

}

}

?>


Muzaffer İlbey Poyrazoğlu Muzaffer İlbey Poyrazoğlu Yeni Üye Tarih: 03.12.2020 Kategori: SQL

hatanin nedeni nedir


Muzaffer İlbey Poyrazoğlu Muzaffer İlbey Poyrazoğlu Yeni Üye Tarih: 03.12.2020