CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Update Users table after sucessful login

Print topic Send  topic

Author Message
RoyBaird

Posts: 115
Posted: 06/08/2010, 6:46 AM

Hi All,
I have tried every combination posted in this forum to update the "users" table with the current date when a user logs on.

I receive no errors or warnings, and I get no data either. I have changed the field type to varchar and used a literal, changed to date and used Now() and a literal. I just cannot get the update to work. ANY help will be appreciated very much.

if (CCGetUserID() > 0)
{
$db = new clsDBstaged();

$SQL = "UPDATE users Set date_last_login = NOW() WHERE user_id =".$db->ToSQL(CCGetUserID(),ccsInteger);

$db->query($SQL);
$db->close();
}
_________________
Roy
View profile  Send private message
datadoit
Posted: 06/08/2010, 7:00 AM

Echo your $SQL to the screen. That will tell you whether or not you're
even matching your if/then condition.
icp4all

Posts: 37
Posted: 06/17/2010, 9:41 PM

just add something like this in the common.php (located in common files)


$SQL = "UPDATE USERTABLE Set last_login_date = NOW() WHERE user_id =".CCGetUserID();
$db->query($SQL);

bevor " return $Result;" in CCLoginUser - Funktion

USERTABLE is the Name of your Table

and be sure that your date format maches with the Serverformat

ps sry about my english, ist a long time since i left scool^^
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 06/19/2010, 3:34 AM

I have something similar to this which works.

So try placing custom code on the Login form After Execute Insert event:

$db = new DBconnectionname();

$SQL = "UPDATE USERTABLE Set last_login_date = NOW()" . " WHERE user_id = " . $db->ToSQL(CCGetSession("UserID"),ccsInteger);

$db->query($SQL);

$db->close();


_________________
Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.