如何删除 Joomla 表格中的一行?
我有一个表
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);
任何更好的解决方案将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)