hi, i have a problem with my code which tells me that my 'user_data() query returned no results!'

here is my user.php
[code]
<?php
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) . '`';
if(($result = mysql_query("SELECT '$fields' FROM `user` WHERE `user_id` = '$user_id'")) !== false)
{
// check that the query did actually return any results
if(mysql_num_rows($result))
{
return mysql_fetch_assoc($result); // return the result
}
// query didn't return any results
else
{
echo 'user_data() query returned no results!';
}
}
// qeuery has failed find out why using msyql_error();
else
{
echo 'user_data() query has failed - ' . mysql_error();
}
}
return false;
}

function logged_in() {
return (isset($_SESSION['user_id'])) ? true : false;

}
function user_exists($username) {
$username = sanitize($username);
$query = mysql_query("SELECT COUNT(`user_id`) FROM `user` WHERE `username` = '$username'");
return (mysql_result($query, 0) == 1) ? true : false;
}
function user_active($username) {
$username = sanitize($username);
$query = mysql_query("SELECT COUNT(`user_id`) FROM `user` WHERE `username` = '$username' AND `active` = 1");
return (mysql_result($query, 0) == 1) ? true : false;
}

function user_id_from_username($username) {
$username = sanitize($username);
$query = mysql_query("SELECT `user_id` FROM `user` WHERE `username` = '$username'");
return (mysql_result($query, 0) == 1) ? true : $user_id;
}

function login($username, $password) {
$user_id = user_id_from_username($username);
$username = sanitize($username);
$password = ($password);

$query = mysql_query("SELECT COUNT(`user_id`) FROM `user` WHERE `username` = '$username' AND `password` = '$password'");
return (mysql_result($query, 0) == 1) ? true : $user_id;
}



?>

any help will be appreciated