У меня проблема с сохранением данных. Все данные в моих 2 формах не сохраняются в базе данных. Это сохранение как ноль. Я уверен, что я получил данные из HTML-формы в контроллер. Я проверил Сеть> Заголовок
Вот мой код
Контроллер
public function add_prop(){
ini_set('max_execution_time', 300);
// property details form
$account_id = $this->session->userdata('login_id');
$td_arp_no = sanitize($this->input->post('td_arp_no'));
$owner = sanitize($this->input->post('owner'));
$address = sanitize($this->input->post('address'));
$administrator_user = sanitize($this->input->post('administrator_user'));
$address_2 = sanitize($this->input->post('address_2'));
$pin = sanitize($this->input->post('pin'));
$tin = sanitize($this->input->post('tin'));
$tel_cell_no = sanitize($this->input->post('tel_cell_no'));
$tin_2 = sanitize($this->input->post('tin_2'));
$tel_cell_no_2 = sanitize($this->input->post('td_arp_no'));
// property location form
$no_street = sanitize($this->input->post('no_street'));
$municipality = sanitize($this->input->post('municipality'));
$land_owner = sanitize($this->input->post('land_owner'));
$building_owner = sanitize($this->input->post('building_owner'));
$longitude = sanitize($this->input->post('longitude'));
$brgy = sanitize($this->input->post('brgy'));
$province_city = sanitize($this->input->post('province_city'));
$parcel_pin = sanitize($this->input->post('parcel_pin'));
$bldg_pin = sanitize($this->input->post('bldg_pin'));
$latitude = sanitize($this->input->post('td_arp_no'));
$prop_id = $this->LandClientModel->add_prop($account_id,$td_arp_no,$pin,$owner,$tin,$address,$tel_cell_no,$administrator_user,$tin_2,$address_2,$tel_cell_no_2,$no_street,$brgy,$municipality,$province_city,$land_owner,$parcel_pin,$building_owner,$bldg_pin,$longitude,$latitude);
$data = [
"success" => 1,
"prop_id" => $prop_id
];
generate_json($data);
}
Модель
public function add_prop($account_id,$td_arp_no,$pin,$owner,$tin,$address,$tel_cell_no,$administrator_user,$tin_2,$address_2,$tel_cell_no_2,$no_street,$brgy,$municipality,$province_city,$land_owner,$parcel_pin,$building_owner,$bldg_pin,$longitude,$latitude){
$sql = "INSERT INTO land_property_details (
account_id,
td_arp_no,
pin,
owner,
tin,
address,
tel_cell_no,
administrator_user,
tin_2,
address_2,
tel_cell_no_2,
status
) VALUES (
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
)";
$data = array(
$account_id,
$td_arp_no,
$pin,
$owner,
$tin,
$address,
$tel_cell_no,
$administrator_user,
$tin_2,
$address_2,
$tel_cell_no_2,
1
);
$return['property_details'] = $this->db->query($sql,$data);
$property_id = $this->db->insert_id();
$sql2 = "INSERT INTO land_property_location (
prop_id,
account_id,
no_street,
brgy,
municipality,
province_city,
land_owner,
parcel_pin,
building_owner,
bldg_pin,
longitude,
latitude
) VALUES (
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
)";
$data2 = array(
$property_id,
$account_id,
$no_street,
$brgy,
$municipality,
$province_city,
$land_owner,
$parcel_pin,
$building_owner,
$bldg_pin,
$longitude,
$latitude
);
$return['property_location'] = $this->db->query($sql2,$data2);
return $return;
}
Я делал это, но впервые столкнулся с этой проблемой.
Что я должен делать? В чем проблема?