Hey Guys
Currently building a login for my site, am going through and testing some stuff, and was wondering what was wrong. What should happen as I print_r this code is a display of the requested fields for the user. This is just a test for me as I am running. However, I get a
"Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homepages/28/d413246400/htdocs/TheDarkMasons/userData/core/functions/users.php on line 14"
error.
Any suggestions
Here is the user_data function
And here is where $fields is picked up from
Thanks for any help.
Currently building a login for my site, am going through and testing some stuff, and was wondering what was wrong. What should happen as I print_r this code is a display of the requested fields for the user. This is just a test for me as I am running. However, I get a
"Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homepages/28/d413246400/htdocs/TheDarkMasons/userData/core/functions/users.php on line 14"
error.
Any suggestions
Here is the user_data function
function user_data($userID) {
$data = array();
$userID = (int)$userID;
$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 `userData` WHERE `userID` = '$userID'"));
print_r($data);
die();
return $data;
}
}
And here is where $fields is picked up from
if (logged_in()===true) {
$session_user_id = $_SESSION;
$user_data = user_data($session_user_id, 'userID','displayName','firstName','secondName','emailAddress','passWord');
}
Thanks for any help.









