I'm sorry but I don't understand the example you gave me.
$query = mysql_query("select YEAR(date) AS tempYear from table");
while ($rows=mysql_fetch_array($query))
{
echo $rows['tempYear'];
}
I want to get the hour difference so I'm changing it to this
$query = mysql_query("select hour(time) AS temphour from table");
while ($rows=mysql_fetch_array($query))
{
echo $rows['temphour'];
}
is that correct? What about the field where I am getting my info from "last_login"? I don't understand how this gives me the difference in time value from the login time to present time now()
Another question if I'm not pushing it.
I'm trying to get a print out of the date and time in a certain format. I'm using this
select date_format('last_login', '%W %M %d, %Y %I:%i:S %p') from table where username= '$username';
but I keep getting blan results. How do I get the script to accept the the time value from the field "last_login"?