loadobjectList fails if column doesn't exist - Joomla! Forum - community, help and support
i have component has been functioning since j1.5.
am trying upgrade 3.0
i have process trying add or drop column table.
just checking table existence of column first.
this has worked fine in j 3.0 when tries execute select query gives me 500 exception.
here current code, have commented out older setquery statement , added jdatabasedriver method both give me same exception.
am trying upgrade 3.0
i have process trying add or drop column table.
just checking table existence of column first.
this has worked fine in j 3.0 when tries execute select query gives me 500 exception.
here current code, have commented out older setquery statement , added jdatabasedriver method both give me same exception.
code: select all
//drop column profile fields
//$this->_db->setquery("select $this->name #__classifiedsredux_profile 1");
$query = $this->_db->getquery(true);
$query->select($this->name)
->from('#__classifiedsredux_profile')
->where( 1 );
$this->_db->setquery($query);
$this->_db->loadobjectlist();
if (!$this->_db->geterrornum()) {
$this->_db->setquery("alter table #__classifiedsredux_profile drop `$this->name`");
$result = $this->_db->execute();
}
hi,
why don't use method gettablecolumns instead of select can fail ?
http://api.joomla.org/joomla-platform/d ... blecolumns
then check if column exist
why don't use method gettablecolumns instead of select can fail ?
http://api.joomla.org/joomla-platform/d ... blecolumns
then check if column exist
Comments
Post a Comment