SHARE
TWEET

Untitled

a guest Jan 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function update_order($id,$old_order){
  2.  
  3.     //Update The order
  4.     $query = $this->db->query("SELECT * FROM cat WHERE `cat_order`='$old_order' ");
  5.     $row =  $query->row();
  6.  
  7.     $this->db->query("UPDATE cat SET cat_order='".$row->cat_order."' WHERE id='".$id."' ");
  8.     $this->db->query("UPDATE cat SET cat_order='$old_order' WHERE id ='".$row->id."' ");
  9.  
  10. }
  11.    
  12. $sql = "UPDATE table SET column = ? WHERE id = ?";
  13. $this->db->query($sql, array($value, $id));
  14.    
  15. $this->db->query(
  16.   "UPDATE cat SET cat_order='".$row->cat_order."' WHERE id = " .$id );
  17.  
  18. $this->db->query(
  19.   "UPDATE cat SET cat_order='$old_order' WHERE id = " . $row->id );
  20.    
  21. $this->db->where('id',$id);
  22. $this->db->set('cat_order',$row->cat_order);
  23. $this->db->update('cat');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top