I am trying out CodeIgniter 4 and I have a problem inserting data.
In my model I only defined the table name, no methods, no nothing. I can display all data in my table but when it comes to inserting data something goes wrong.
My controller code looks like:
$data = [
'sum' => '23',
'type' => 'in',
'name' => 'asd'
];
$expense = new ExpensesModel();
try {
var_dump($expense->insert($data));
} catch (ReflectionException $e) {
var_dump($e);
}
When I call this endpoint using Postman I get a 500 internal server error
.
If I die('asd')
before the try-catch
I can see the message so this makes me think something happens during the insert
method call.
How can I debug this ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…