0

when i execute the below code , i show this error: Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in

<?php 
$personal_name="root.root";
$resposta=array("validar" => "correcte");
$json=json_encode($resposta);
$res=mysqli_real_escape_string($json);

$query_it=mysqli_query($conexio," INSERT INTO menu values('".$personal_name."','".$res."','".$res."','".$res."','".$res."','".$res."')");
if($query_it){

echo "correct";
    }
    else{
    echo "incorrect";

    }

?>
riztak
  • 55
  • 2
  • 8
  • `mysqli_real_escape_string($conexio, $json)` will resolve your error but there are more issues then that, and you should switch to prepared statements with mysqli or pdo – cmorrissey Apr 15 '16 at 15:57
  • Please do a search before asking a question, this one has already been asked. Apart from that its not rocket science to read this error message and realise that a quick look at the PHP manual would probably get you sorted in less time that it takes to ask a question here! [The PHP Manual](http://php.net/manual/en/index.php) – RiggsFolly Apr 15 '16 at 16:05
  • it works correctly.thanks! – riztak Apr 15 '16 at 16:54

0 Answers0