Why Parse error: syntax error, unexpected 'if' (T_IF)?

Type: ParseError

Message: syntax error, unexpected 'if' (T_IF)

system/database/drivers/mysql/mysql_driver.php

Line Number: 140


that's 140-175строка
// Select the DB... assuming a database name is specified in the config file
 if ($this->database !== "&& ! $this->db_select())
{
 log_message('error', 'Unable to select database: '.$this->database);

 return ($this->db_debug === TRUE)
 ? $this->display_error('db_unable_to_select', $this->database)
 : FALSE;
}

 if (isset($this->strict is on) && is_resource($this->conn_id))
{
 if ($this->strict is on)
{
 $this->simple_query('SET SESSION sql_mode = CONCAT(@@sql_mode, ",", "STRICT_ALL_TABLES")');
}
else
{
$this->simple_query(
 'SET SESSION sql_mode =
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
@@sql_mode,
 "STRICT_ALL_TABLES,", ""),
 ",STRICT_ALL_TABLES", ""),
 "STRICT_ALL_TABLES", ""),
 "STRICT_TRANS_TABLES,", ""),
 ",STRICT_TRANS_TABLES", ""),
 "STRICT_TRANS_TABLES", "")'
);
}
}

 return $this->conn_id;
}

 // --------------------------------------------------------------------
April 3rd 20 at 18:56
2 answers
April 3rd 20 at 18:58
because the syntax error
April 3rd 20 at 19:00
Confused by the last closing quote. The code inside the method-function is?

Find more questions by tags PHP