I am creating a Login form that captures the values so I can use throughout the session when the user gets pass the regular Login page. I have input in MySQL as follows:
user_id | username | password | firstname | lastname | email | website | active | date_added
I created a function to capture data but it doesn't return anything. Can anyone help me with this?
Here is what the code looks like:
function user_input($user_id) {
$input = 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) . ' `';
$query = mysql_query("SELECT '$fields' FROM Login WHERE user_id = '$user_id' ");
$input = mysql_fetch_assoc($query);
print_r($input);
}
}