First off, you need to use the time() function and set the `online` column on your table equal to the output of that function.
Then, based off of the difference between the current time and what is stored, you can find (in seconds), how long a person has been online.
Doesn't this code need a MYSQL because am getting these errors:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/u690474005/public_html/user_index.php on line 32
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/u690474005/public_html/user_index.php on line 40
There are No users online