[code]function update_row() { // Get the raw input from the request $raw_input = $this->input->raw_input_stream; log_message('info', 'Raw input: ' . $raw_input);
// Decode the JSON input $data = json_decode($raw_input, true);
// Ensure data is an array and contains the necessary fields if (!is_array($data) || !isset($data['id'])) { log_message('error', 'Decoded data is not an array or missing ID. Data: ' . print_r($data, true)); echo json_encode(['status' => 'error', 'message' => 'Missing ID']); return; }
// Log the data for debugging log_message('info', 'Received data: ' . print_r($data, true));
// Process and update the data $update_result = $this->Logistic_m->update_row($data);
if ($update_result) { log_message('info', 'Row updated successfully'); echo json_encode(['status' => 'success']); } else { log_message('error', 'Database update error'); echo json_encode(['status' => 'error', 'message' => 'Database update error']); } } [/code] Я пытаюсь сохранить строку, но интерфейс успешно обновляется, но база данных не обновляется