hi guys,
pls help me out..
how can i insert the current date into mysql data base through php ??
n pls tell how to retrieve also..
its urgetnt..!!
rohit b k
0
Newbie Poster
Recommended Answers
Jump to PostHi,
Using php you can accomplish this using date() function like below,
$date = date("Y-m-d H:i:s"); $query = mysql_query("insert into tablename (`dated`) values ('".$date."')");
Another way using mysql function now(),
$query = mysql_query("insert into tablename (`dated`) values (now())");
Provide some info about your …
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.