i need to insert my option value into database with this option view :
<label>Add Time</label>:
<select id="dropdownHolder" name="restaurant_busy">
<option value="1">30 minute</option>
<option value="2">1 hour</option>
<option value="3">1 hour 30minute</option>
<option value="4">2 hour</option>
</select>
this the controller what i have done :
function change_restaurant(){
if(!isset($_COOKIE["vendor_login"])){ redirect("/VENDOR",'refresh'); }
if(!$this->Token_m->m_check_token($this->input->cookie('vendor_login'),$this->input->cookie('vendor_token'))){
setcookie('vendor_login', '', time() - 3600, '/');
redirect('/VENDOR/',"refresh");
}
if ($this->input->cookie('vendor_login') != null) {
$admin_name = $this->input->cookie('vendor_login');
setcookie('vendor_login', $admin_name, time() + 28800, '/');
$msg = $this->input->cookie('vendor_token');
setcookie('vendor_token', $msg, time() + 28800, '/');
}
if($vendorname = $_COOKIE["vendor_login"]) {
$check_login = $this->Vendor_m->m_get_user_by_vendor($vendorname);
$restaurant_id = $check_login["restaurant_id"];
{
if ($_POST = NULL){
redirect("/VENDOR/Vendor/restaurant_setting","refresh");
}
$data = array(
"restaurant_info"=>$this->input->post("restaurant_info"),
'restaurant_busy' => $this->input->post("restaurant_busy")
);
$this->Vendor_m->m_update_restaurant_info( $data,$restaurant_id);
$this->db->last_query();
}
}redirect("/VENDOR/Vendor/restaurant_setting","refresh");
}
this the model :
function m_update_restaurant_info($restaurant_info, $restaurant_id)
{
$this->db->where("restaurant_id", $restaurant_id);
$this->db->update("uhd_restaurant", $restaurant_info);
}
that its my option value, in my database there is a table name "uhd_restaurant" and the field is "restaurant_busy", in restaurant_busy there are some comments like : 0=no busy(as default), 1=30 minute, 2=1 hour, 3=1 hour 30 minute, 4= 2 hour.
if i select 30minute, in restaurant_busy must be 1, what should i do in controller and in model?
and after i submit it i got this following error :
A Database Error Occurred
Error Number: 1054
Unknown column 'restaurant_info' in 'field list'
UPDATE
uhd_restaurant
SETrestaurant_info
= NULL,restaurant_busy
= NULL WHERErestaurant_id
= '250'Filename: C:/Data_web/food.km/application/models/VENDOR/SG/Vendor_m.php
Line Number: 554