Jump to content

Date function


wrathican

Recommended Posts

hey, ive never used the date function before and now i need to know how to get it and format it to insert into a mysql databse and also get it from a mysql database and format it for being echoed.

i know how to pull stuff from DB's and insert them no problems but im just stuck with this.

any help?

Link to comment
https://forums.phpfreaks.com/topic/57261-date-function/
Share on other sites

here is an example snippets from my site that may help you..

 

this stores the date/time in database

    $sql2 = "UPDATE employees SET last_login=NOW() WHERE username = '$checkuser' LIMIT 1";   

 

 

this will select date time from table for display on web page in standard time

 

$last_login = ("SELECT DATE_FORMAT(last_login,  '%b %e %Y at %r') aS last_login FROM employees WHERE username = '$checkuser' LIMIT 1");

 

Link to comment
https://forums.phpfreaks.com/topic/57261-date-function/#findComment-283103
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.