PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I return the date with mySQL?


Often there will be times where you want to return the date in your mySQL query or insert it into a table.

For instance when a user registers for the site, you might want to record the date they registered on, and so forth.

To do so, use the CURDATE() function within mysql, like this:

<?php
$todayis 
mysql_query("SELECT CURDATE() FROM table");
$itis mysql_result($todayis,0,0);
echo 
"Today is: $itis";
?>



More mysql PHP Questions

How do I access the current time with mysql?
How do I find second highest value from a table?
How do I group the results of a mysql query?
How do I set a default value for ENUM fields in PHP?
How do I find the ID of a new row added to a table?