Problem inserting date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Problem inserting date

Post by xionhack »

Hello, I have a query, and when I run it the date is never inserted. What is the problem? The field where that date is inserted is a "date" type. Can somebody tell me what is the problem? Thanks!

Code: Select all

 
INSERT INTO activity (type_activity, details, date, member_id)
VALUES (1, 'activity', '1/1/2009', 1)
 
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Problem inserting date

Post by califdon »

The default format for a 'date' type field is like '2009-01-01'.
xionhack
Forum Contributor
Posts: 100
Joined: Mon Nov 10, 2008 9:22 pm

Re: Problem inserting date

Post by xionhack »

Thanks for your quick response. Is there a way for it to insert it independently of how you write it? Something like a conversion function or something like that
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Problem inserting date

Post by califdon »

Post Reply