Codeigniter Query |
i have problem to saving data
this is my Model i use Sql Server Database function UpdateEdit($data) { $this->db->trans_start(); $sql = " update [do] set customer='" . $data['Customer'] . "', tgl='" . $data['Tgl'] . "', Notes='" . $data['Notes'] . "', Total=" . $data['Total'] . " where doid='" . $data['Doid'] . "'"; print_r($sql); $head = $this->db->query($sql); $this->db->delete("from DoDtl where Doid='" . $Doid . "'"); $this->db->query($data['Detail']); $this->db->trans_complete(); return TRUE; }
@amansusanto,
What errors are you seeing? Also, I wouldn't do you query like that. You could open yourself up to sql injections. I would use this the query binding method instead (https://www.codeigniter.com/userguide3/d...y-bindings ). PHP Code: $sql = " update [do] set customer=?, tgl=?, Notes=?, Total=? where doid=?"
(04-06-2019, 12:23 PM)php_rocs Wrote: @amansusanto, i have wrong type table column name. now already solved.. Thank you |
Welcome Guest, Not a member yet? Register Sign In |