Notice : Array to string conversion
every time i try to call
call_user_func_array ("mysqli_stmt_bind_param", array_merge (array ($stmt,
$types),refValues ($params_array)))
$param_array contains the parameter values and the function refValues returns references of this array
as an example if i executes this request insert into table1(column1) values(value1)
the value of Column1 will be 'Array'.
I'm not sure what is the problem here some say that the notice means that my array contains an array inside it and some say that the array is not an array and I'm perplexed
This is an example of the code
$_POST["params"] contains types and parameters like that "{type1:value1}{type2:value2}"
$ps = mysqli_prepare($cn,base64_decode($nq));
$params = $_POST["params"];
$params_array = array();
$types ="";
while(strlen($params)>0)
{
try
{
$n1 = strpos($params,"{");
$n2 = strpos($params,"}");
$param = substr($params,$n1+1,$n2-($n1+1));
$param_exploded = explode(":",$param);
$type = $param_exploded[0];
$types.=$type;
echo "$type \n";
$param_ex = $param_exploded[1];
echo "$param_ex \n";
$param_ex = str_replace(array("&bg","&sp","&en"),array("{",":","}"),$param_exploded);
array_push($params_array,$param_ex);
if($n2+1>=strlen($params))
break;
$params = substr($params,$n2+1);
}catch(Exception $x)
{
break;
}
}
call_user_func_array("mysqli_stmt_bind_param",array_merge(array($ps),array($types),refValues($params_array)));
mysqli_stmt_execute($ps);
mysqli_close($cn);