Jump to content

Recommended Posts

im building a checkin checkout system

 

how would you approach this:

a user logs on his time and date are recorded and is logged out

 

then what i want is on the next login to update the last record

with time and date when logged out

 

how can i get the  last record entered by  userID?

Link to comment
https://forums.phpfreaks.com/topic/145233-get-last-record-by-userid/
Share on other sites

yes thanks

 

i have the query im trying to call but it isn't filtering the records table using the logged in username session variable:

 

$username_RsLastRecord = "-1";
if (isset($_SESSION['login_Username'])) {
  $user_RsLastRecord = $_SESSION['login_Username'];
}
mysql_select_db($database_shifts, $shifts);
$query_RsLastRecord = sprintf("SELECT * FROM records WHERE records.UserName=$username_RsLastRecord ORDER BY records.ShiftStartTimeStamp DESC", GetSQLValueString($username_RsLastRecord, "int"));
$RsLastRecord = mysql_query($query_RsLastRecord, $shifts) or die(mysql_error());
$row_RsLastRecord = mysql_fetch_assoc($RsLastRecord);
$totalRows_RsLastRecord = mysql_num_rows($RsLastRecord);

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.