Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
when i use
array_map('mysql_real_escape_string', $_POST);
it display
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in D:\xampp\htdocs\...\...\xyz.php on line 14
what is the reason after that?
EDIT:
and if i use
array_walk_recursive($_POST, 'mysql_real_escape_string');
then it display
Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in D:\xampp\htdocs\..\...\xyz.php on line 17
please also tell me the difference above both method?
Thank You in advance
I assume that one of the elements of
$_POSTis indeed an array, visualised something like this:When
array_maptries to give the value of$_POST['element']tomysql_real_escape_string, it throws the error you describe.You could try to wrap the call though, something along this (untested) function: