2

I'm in a small pickle on this one. I'm using Codeigniter controller.

I need to update an Order status where "DATA HERE" is located in the code below.

Basically here is what i need to do locate the $orderid within a table called "orders" find the "status" and update it to the text "Paid".

$orderid = $id;

if($this->input->post("status")=="OK" && $this->input->post("step")=="Confirmation" && $this->input->post("orderhash")==$orderHashOrg)
    {
        // DATA HERE    
    }

Any help is greatly appreciated.

Here is my current code

$updateData=array("status"=>"Paid");

    if($this->input->post("status")=="OK" && $this->input->post("step")=="Confirmation" && $this->input->post("orderhash")==$orderHashOrg)
    {

        $d = $this->db->get('offers_orders');
        $this->db->select('status');
        $this->db->where('order_number', $id);

        $orderdata = $d->result_array();

        $this->db->update("offers_orders", $updateData);

    }
4

2 に答える 2

5

データベース接続が確立されていると仮定します。

 $orderid = $id;

if($this->input->post("status")=="OK" && $this->input->post("step")=="Confirmation" && $this->input->post("orderhash")==$orderHashOrg)
{

$updateData=array("status"=>"Paid");

$this->db->where("orderid",$orderid);
$this->db->update("orders",$updateData);    
}
于 2013-06-28T14:46:05.400 に答える
-2
function update ($data,$id){

    $this->db->where('user.id',intval($id));

    return $this->db->update('user', $data);

}
于 2016-08-24T09:06:43.677 に答える