PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject_FormBuilder » Bug #4363

Problem with some colum names

Details

Submitted2005-05-17 11:53 UTC
Frommarc at cargol dot net
Assignedjustinpatrin
StatusBogus
PackageDB_DataObject_FormBuilder
PHP Version4.3.11
OSDebian GNU/Linux
Roadmaps(Not assigned)

Comments

[2005-05-17 11:53 UTC] marc at cargol dot net

Description:
------------
If I have a table like this one.

CREATE TABLE categories (
id int NOT NULL auto_increment,
`value` varchar(40) NOT NULL default '',
`desc` varchar(200) NOT NULL default '',
PRIMARY KEY (id)
);

processForm method returns an error with auto-generated SQL.

UPDATE categories SET value = 'testCat324' , desc = 'rewrwe' WHERE categories.id = 2;

It didn't work because "desc" is a reserved word in mysql and must be written with ''.

I resolved the problem changing column names but I thing you can resolve this putting columns names between ``.

Thanks for all.

Reproduce code:
---------------
if ($form->validate()) {
$fg -> forceQueryType(DB_DATAOBJECT_FORMBUILDER_QUERY_FORCEUPDATE);
$form -> process(array(&$fg,'processForm'), false);
$t->assign('html',_("<h4>Success editing $getClass.</h4>"));
$t->display('contentHtml.tpl');
}

Expected result:
----------------
The class should be updated ....