I'm trying to run this query with mysqli :
"SELECT * FROM campaigns WHERE user_id = ".$_SESSION['username']['user_id']." AND status = 'Paused'"
And I'm getting the following error :
There was an error running the query [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'Paused\'' at line 1]
I've searched for a solution but found none.
Any suggestions?
More code
public function query($query) {
$query = $this->db2->real_escape_string($query);
if(!$result = $this->db2->query($query)) {
die('There was an error running the query [' . $this->db2->error . ']');
}
$this->count = $result->num_rows;
return mysqli_fetch_all($result, MYSQLI_ASSOC);
$result->free();
}