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

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



ASK A QUESTION

More mysql PHP Questions

the uploading status shows success but not showing in the server is empty the written php file is first gave warning cannot uploaded warning in foreach loop but i corrected mistake by keeping above if condition and no error status shows success upload b

How do I return a random row from the database?

How do I find the number of rows affected by a query?

How do I update the contents of a table row?

How do I find the number of rows in a result set?



Custom Search