I am using a free hosting service that support Yii partially. Though it does not support PDO extention of MySQL, I changed to use SQlite from MySQL when the application works fine for MySQL. Then, I have to change somewhat the definition of the table as follows.
Quote
CREATE TABLE `Offkai` (
:
- modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
+ modified timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL
);
sqlite3 executed with no error, but I found there is an error saying 'CDbCommand はSQL文を準備できません。:SQLSTATE[HY000]: General error: 1 no such function: NOW'.
What is the good way to prepare auto timestamp function in SQLite, or is it a bug?
○UPDATE 'Sankasya' SET "id"=:_p0, "offkaicode"=:_p1, "sankasya"=:_p2, "password"=:_p3, "honbun"=:_p4, "modified"=datetime('NOW','localtime') WHERE 'Sankasya'."id"=175
It does not work at insertion, the column "modified" being 0.
It is very strange that Yii generates the SQL code using the column "modified" because there is no description in the rule of the model definition as below.
I am not an expert on database but I have been using mysql and sqlite for quite a long time. One of my host has a very crappy mysql server so I have to use sqlite.
Sqlite does not have that many built-in functions like mysql. For example, I like the INET_ATON function in mysql but sqlite does not support this.
For your question, it works fine on my isp host and localhost with PHP5.2.9 and sqlite3 with "CDbExpression('NOW()')". What is your php and sqlite version?