Jump to content

[SOLVED] UPDATE Timestamp?


MadDawgX

Recommended Posts

Hey there, I'm having some problems on updating a timestamp field (active) in my Table (users).

 

Here's what I got:

 

// QUERY - Get User Data
$qUserData = "SELECT * FROM users WHERE name='$LogUsername'";
$rUserData = mysql_query($qUserData) or die('Query failed. ' . mysql_error());
// Get Data
$LogId = mysql_result($rUserData,0,'id');
// QUERY - Update Last Active
$qLastLog = "UPDATE users SET active=unix_timestamp() WHERE id='LogId'";
$rLastLog = mysql_query($qLastLog) or die('Query failed. ' . mysql_error());

 

It just doesn't work. A couple things:

 

1. $LogId is returing 1 which is correct.

2. Nothing is affected in the active field of the row with id of 1.

 

- Thanx

Link to comment
https://forums.phpfreaks.com/topic/37685-solved-update-timestamp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.