I am trying to make a database class and want to have real_escape string in it but whenever I do so I don't get any results. Please help:
<!DOCTYPE html>
<head>
<title>PHP Classes</title>
</head>
<body>
<?php
class Database
{
function Database($host, $user, $pass, $db){
$this -> con = mysqli_connect($host, $user, $pass, $db);
}
function runQuery($query){
mysqli_query($this -> con, $query);
}
}
?>
<?php
$database = new Database("localhost", "root", "", "website");
$database -> runQuery("DELETE FROM subject WHERE name = 'Footer'");
?>
</body>
</html>