如何使用angularjs更新codeIgniter中的记录
我创建了一个函数如何使用angularjs更新codeIgniter中的记录,angularjs,codeigniter,Angularjs,Codeigniter,我创建了一个函数 <button data-toggle="modal" ng-click="edit(school.school_ID)" data-target="#edit-data" class="btn btn-primary">Edit</button> 在mycontroller/myfun中访问 public function myfun(id) { $q = $this->db->get_where('tablenam
<button data-toggle="modal" ng-click="edit(school.school_ID)" data-target="#edit-data" class="btn btn-primary">Edit</button>
在mycontroller/myfun中访问
public function myfun(id)
{
$q = $this->db->get_where('tablename', array('school_ID' =>
id));
echo json_encode($q->row());
}
问题出在哪里问题出在哪里?我在代码中看到的一个问题是id没有传递回CodeIgniter应用程序。我在代码中看不到任何更新查询。您刚刚编写了select查询。
public function myfun(id)
{
$q = $this->db->get_where('tablename', array('school_ID' =>
id));
echo json_encode($q->row());
}