ShoeLace1291 Posted November 21, 2007 Share Posted November 21, 2007 How do I insert today's date in a certain database row without using the date() function for a string? For example, when you use PHPMyAdmin to insert a new table row and there's a column with the type "date", it gives you options such as CURDATE, NOW, etc. How would I use that in a database query? Quote Link to comment Share on other sites More sharing options...
Wuhtzu Posted November 21, 2007 Share Posted November 21, 2007 Short answer isn't always the best, but always better than nothing http://www.gizmola.com/blog/archives/51-Exploring-Mysql-CURDATE-and-NOW.-The-same-but-different..html Quote Link to comment Share on other sites More sharing options...
BenInBlack Posted November 21, 2007 Share Posted November 21, 2007 if the field is datetime use now() if it is date use curdate() example INSERT INTO `iislogs` ( `ClientHost`, `Username`, `LogTime` ) values ('Host','User',now()); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.