inserting DATE's using DB_DataObject 1.7.10
| From: | Yashesh Bhatia | Date: | Thu, 17 Mar 2005 07:23:42 +0000 |
| Subject: | inserting DATE's using DB_DataObject 1.7.10 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18098@lists.php.net to get a copy of this message | ||
hello:
i'm trying to insert a field of type DATE into the table using
DB_DataObject 1.7.10 but it does not insert it.
here's my setup.
OS : Fedora Core 2
PHP : 5.0.3
Mysql Server version: 5.0.2-alpha for pc-linux (i686)
PEAR 1.3.4 stable
DB 1.7.4 stable
DB_DataObject 1.7.10 stable
being a newbie i tried borrowed code/help from the article
http://www.onlamp.com/pub/a/php/2004/12/09/three_tier.html
so here's what i did.
1 - created an example.ini file
2 - created a database (db_dataobjects) and a table (user)
3 - ran the generator
[yvb@bfc11 ex1]$ php
/usr/local/php5/lib/php/DB/DataObject/createTables.php example.ini
4 - ran a test script to insert a record into the database.
now i checked my database and instead of getting "1980-25-10" i get the
date as 0000-00-00.
i would appreciate if anyone can help me fix the problem and also why a
valid string is not inserted into the mysql db.
i've attached the following files.
- example.ini - main config file
- User.php - generated class file
- db_dataobject.ini - generated schema file
- configDB.php - application wide include file
- test1.php - test script
thx a lot in advance.
rgd.
yasheshb.
--
go pre
http://www2.localaccess.com/rlalonde/pre.htm