PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I access the current time with mysql?


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'");
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More mysql PHP Questions

Why will this statement not print a column with "lastname space firstname"? Print " .$info['businessname'] "; Print " .$info['firstname']. " " .$info['lastname'] "; I want to see 2 columns - a

I am unable to make pages for my search result.Below I am giving the code that I am using. Career Search result Yami says

How do I find second highest value from a table?

My website www.quicheandpie.com has navigation buttons which were added by going to admin/categorylist and adding a category. I can add category = navigation buttons and update them, but I can not delete them. Any ideas how I can find where the info

What is difference between mysql_fetch_array and mysql_fetch_object?



Custom Search