I have a page that collect many data and i need to escape those data before made a sql query insert into db.
I write this before the SQL query :
foreach($_POST as $k => $v) $_POST[$k] = mysqli_real_escape_string($conn,$v);
My $conn is :
$conn = new mysqli('localhost', 'xxx', 'yyy', 'zzz');
Still work but i'm not sure if it's safe.