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

How do I connect to mySQL from PHP?

How do i list a record in front that is recently added to the table?

I have a database with a table and in the table I have a row named php_code and I want to print the code of this row in my site as script. Example in row: and in my site: hello.

I am extracting data from a MySQL Database of which one of the data stored is seperated by a comma. For example, step1,go here,step 2,go there,step 3,go back etc etc. I want to know how to split the data at the comma and format it in html. Using the split

What is the correct way to connect to a MySQL database?



Custom Search