Chaitanya Lakshmi
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook

How do I access the current time with mysql?

4/10/2012

0 Comments

 
Another common query is to get to the current time in addition to the date within mysql.

When you want to log when something happens - for instance a post to your message board, this will be a particularly useful thing to know.

With the current time and date you will need to use NOW() like so:

<?php 
$update = mysql_query("UPDATE my_users SET lastlogin = NOW() WHERE username = 'elvis'"); 
?>
0 Comments



Leave a Reply.

    Archives

    April 2012
    March 2012
    February 2012

    Categor

    All
    Ajax
    Api
    Cross Site Scripting
    Css
    Curl
    Design Patterns
    Drupal
    Exception Handling
    Htaccess
    Html
    Javascript
    Jquery
    Json
    Linux
    Mysql
    Oops
    Php
    Regular Expressions
    Web 2.0
    Webservices
    Wordpress
    Xhtml

    RSS Feed

Powered by Create your own unique website with customizable templates.