So I'm no expert with PHP and have been learning procedural since now, when I've decided to try out some OOP. I tried creating a MySQL escape function to prevent SQL injection, but the error "Fatal error: Cannot re-assign $this" gets spit out.
public function escape($result) {
global $this->con;
return mysqli_real_escape_string($this->con, $result);
}
When I remove "global", the error is no longer present but need such.
Thanks.