Page 1 of 1

Date

Posted: Sat Aug 30, 2008 5:31 am
by gigabayt
Hi!

I want my members to see when their referral was logged in last. Right now it just shows 0000-00-00 I 've logged in and out but notjing seems to change, what is the problem? Why aren't php writing in my mysql database?

Thanks guys!

Re: Date

Posted: Sat Aug 30, 2008 9:54 am
by Christopher
The login is just a select. You need to update the field with something like:

UPDATE mytable SET mydate=NOW() WHERE id='$id'

Re: Date

Posted: Sat Aug 30, 2008 2:00 pm
by gigabayt
It posted before a login date, but it just looked like this: 665258945 Just some numbers, and now I want them to look like 2008-08-30

Login.php

Code: Select all

$lastlogdate=time();
I tried your code but I just get a white page with T_string problem :(

Re: Date

Posted: Sat Aug 30, 2008 2:48 pm
by Christopher
You need to read up on the functions, but in the PHP and MySQL manual, that return timestamps and that return date strings.