, that fixed the issue but now something wierd is happening. Not many members have logged in since I added the loginDateTime column in my db. So with the first code it just displayed nothing for members that haven't logged and that is fine. But with the new code if they haven't logged in it populates the field anyway with today's date and a time of 00:00:00... Any ideas as to why this is happening?
What's in $qry['lastLoginDate'] when the user hasn't logged in before?
Also, I suggest using unix timestamp or mysql's timestamp to store time / dates. Storing it as string (eg. December 26, 2007) and converting it to another date format is a lot slower than simply storing it in a unix timestamp and converting it using date().
In fact, if you use unix timestamp to store dates in mysql, you can make the default value for the last login column in your table a '0' and use the code:
[PHP]if ($qry['lastLoginDate'] != 0) {
// not the first time to login... showing the date
echo date("d/m/Y", $qry['lastLoginDate']);
} else {
// else, do nothing... or echo "Never"[/PHP]
}
This method is a lot more effecient since you only need to convert it once from timstamp to date, instead of converting it twice from a string, to timestamp, and then back to date.
Also, your problem is is that when you put that into the database the time will be 00:00:00 because it cannot be read right. Like the database cannot order that when displaying. You need to have it stored normally, but displayed with the edited version.