It says:
- Warning: Missing argument 1 for users_data()
- Notice: Undefined variable: user_id
- Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given
My function:
function users_data($user_id)
{
        $data =array();
        $user_id = (int)$user_id;
    $query = mysql_query("SELECT * FROM `sun` WHERE `user_id` ='$user_id'");
    $user_data = mysql_fetch_array($query);
    return $user_data;
}
What to do?
I know that $user_id is not defined tell me how to define $user_id
I have done $user_id = $_SESSION['use_id'];; then it says undefined index... 
Then i use $sql = "Select * from users Where user_id= ???" this is where i got stuck 
Can anyone tell me how to solve this?
Please don't tell me to add user_id = 1,2,3 etc. because I am working on Login and Registration Form and Displaying users data.
 
     
    