[PHP] Array_Walk error messages

2004-11-07 Thread Stuart Felenstein
Can anyone give me a clue what I have done wrong here.

//These would be passed as ints:
array_walk($l_industry, 'mysql_escape_string');
Warning: Wrong parameter count for
mysql_escape_string() in
/xxx//public_html/Test2.php on line 104

//These would be passed as ints:
array_walk($l_tterm, 'mysql_escape_string');
Warning: Wrong parameter count for
mysql_escape_string() in
/xxx//public_html/Test2.php on line 105

//These are strings
array_walk($skills, 'mysql_escape_string');
Warning: Wrong parameter count for
mysql_escape_string() in
/xxx/x/public_html/Test2.php on line 106

//These are ints:
array_walk($skys, 'mysql_real_escape_string');
Warning: mysql_real_escape_string() expects parameter
2 to be resource, integer given in
/xxx/x/public_html/Test2.php on line 107

//These are ints:
array_walk($slus, 'mysql_escape_string');
Warning: Wrong parameter count for
mysql_escape_string() in
/xxx//public_html/Test2.php on line 108


Thanks
Stuart

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Array_Walk error messages

2004-11-07 Thread Curt Zirzow
* Thus wrote Stuart Felenstein:
 Can anyone give me a clue what I have done wrong here.
 
 //These would be passed as ints:
 array_walk($l_industry, 'mysql_escape_string');
 Warning: Wrong parameter count for
 mysql_escape_string() in
 /xxx//public_html/Test2.php on line 104
 

The callback function form array_walk expects to parameters:
  callback($key, $value);

But mysql_escape_string() only takes one.

As suggested earlier, use array_map() instead.


Curt
-- 
Quoth the Raven, Nevermore.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php