DATE Functions tutorial in PHP

If we want to get current date then we can use below shown sql query :

SELECT CURRENT_DATE();            OR      We can use

SELECT CURDATE();


If we want to get current date with time then we can use below sql query :

SELECT SYSDATE();

we can also use 

SELECT NOW();

If we want to find out month from sql query then we can use below shown sql query :

SELECT MONTH("2019-10-15 09:34:21") AS DATE;

Comments

Popular posts from this blog

Ajax Insert Records in Database Tutorial in PHP

Displaying Database data using Class, Object, Constructor, Destructor in PHP MySql

SubQuery with EXISTS and NOT EXISTS in PHP