我有一张桌子
id h_id t_id
1 3 1
2 3 2
3 3 3
4 4 2
5 4 3
id
是主键。我还没有JTable
为这个表创建一个。现在我想删除行h_id
。有什么方法可以在不编写 sql DELETE 查询的情况下使用吗?
$db = JFactory::getDBO();
$row =& $this->getTable('tablename');
$row->delete($pk);
任何更好的解决方案将不胜感激。