باسلام من در مدلم دچار ایرادی هستم که نمیدونم چیه
کد کلاس :
کد کلاس :
<?php
class Model{
protected $con;
public function __construct()
{
$this->coect();
}
public function coect()
{
if (!$this->con) {
$config = Loader::load('Configs');
$this->con = new mysqli($config->dbHost, $config->dbUser, $config->dbPass, $config->dbName);
$this->con->query('SET NAMES 'utf8 '');
$this->con->set_charset('utf8');
}
if ($this->con->coect_ero) {
exit($this->con->coect_error);
}
}
public function query($query)
{
retu $this->con->query($query);
}
public function escape($value)
{
retu is_null($value) ? 'null' : ''' . $this->con->real_scape_string($value) . "';
}
public function insertId()
{
retu $this->con->insert_id;
}
public function arrayQuery($query)
{
$result = [];
$values = $this->query($query);
if ($values && $values->num_rows > 0) {
while ($value = $values->fetch_assoc()) {
$result[] = $value;
}
}
retu $result;
}
}
بیشتر ازین خط ارر میده فکر کنم :
retu is_null($value) ? 'null' : '' . $this->con->real_scape_string($value) . '';
