EllisLab text mark
Advanced Search
     
please correct my code
Posted: 28 September 2012 11:25 AM   [ Ignore ]
Joined: 2012-09-18
15 posts

hello again

can anyone correct my code

Model

function update_order($id,$old_order){
    

    
//Update The order
    
$query $this->db->query("SELECT * FROM cat WHERE `cat_order`='$old_order' ");
    
$row =  $query->row();
    
    
$this->db->query("UPDATE cat SET cat_order='".$row->cat_order."' WHERE id='".$id."' ");
    
$this->db->query("UPDATE cat SET cat_order='$old_order' WHERE id ='".$row->id."' ");
     
 
Posted: 29 September 2012 05:55 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-05-14
2 posts

what error message did you get.. maybe i could help you

you could also try to use the codeigniter update function http://ellislab.com/codeigniter/user-guide/database/active_record.html#update