how I delete a row in a table in Joomla?

Posted by Sara on Stack Overflow See other posts from Stack Overflow or by Sara
Published on 2011-12-08T16:09:00Z Indexed on 2013/11/03 21:55 UTC
Read the original article Hit count: 291

I have a table

id h_id t_id
 1   3   1
 2   3   2
 3   3   3
 4   4   2
 5   4   3

id is the primary key. I have not created a JTable for this table. Now I want to delete rows by h_id. Are there any method like which I can use without writing a sql DELETE query?

$db = JFactory::getDBO();
$row =& $this->getTable('tablename');
$row->delete($pk);

Any better solution will be greatly appreciated.

© Stack Overflow or respective owner

Related posts about joomla

Related posts about joomla1.5