I have the following function :
function user_data($user_id) {
$data = array();
$user_id = (int)$user_id;
$func_num_args = func_num_args();
$func_get_args = func_get_args();
if ( $func_num_args > 1 ) {
unset($func_get_args[0]);
$fields = '`' . implode('`, `', $func_get_args) . '`';
$data = mysql_fetch_assoc( mysql_query(" SELECT $fields FROM `users` WHERE `user_id` = $user_id ") );
return $data;
}
}
the error message that I get is : Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mytest\core\functions\users.php on line 271 Any idea where is the problem with my function?