Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-04-11 10:47:24
- Siguo
- Member
- From: Beijing, China
- Registered: 2008-05-22
- Posts: 44
rewrite safe_insert and insert into sqls
I’m coding a SQLITE version txp for my use this week, and find a problem with the safe_insert function.
this is the definiton in txplib_db.php:
function safe_insert($table,$set,$debug='')
{
....
$q = "insert into ".safe_pfx($table)." set $set";
......
}
the problem is txp use this form for insert into table:
insert into tablename set foo = bar….
but sqlite doesn’t support this form. it only support this form:
insert into tablename (foo) values (bar)
maybe it’s good to use the second form, because all database support it, and it will help txp to support other database in future.
Last edited by Siguo (2010-04-11 11:40:10)
Offline