【发布时间】:2015-04-27 14:15:33
【问题描述】:
function delete_ScormByIdPlataforma($id_platform)
{
$query = $this->db->query("delete from scormvars where scoinstanceid in
(select scoinstanceid from dispatch where id_licencia in
(select id_licencia from licencias where id_plataforma = $id_platform))");
// return true;
}
这是我模型中的函数,查询没问题,但是不知道怎么执行查询。
【问题讨论】:
-
如果您的数据库在 application/config/database 中配置良好,这就是您在 codeigniter 中执行查询的方式。如果查询成功或失败,这里 $query 是 true 或 false。你可以写:
function delete_ScormByIdPlataforma($id_platform) { return $this->db->query("delete from scormvars where scoinstanceid in (select scoinstanceid from dispatch where id_licencia in (select id_licencia from licencias where id_plataforma = $id_platform))"); } -
好的,现在我收到一个错误:不允许删除,除非它们包含“where”或“like”子句。文件名:C:\wamp\www\WiccoCloud\system\database\DB_active_rec.php 行号:1567
-
我想你应该在这里找到你需要的东西:stackoverflow.com/questions/26589378/…
标签: php codeigniter