hi there!
i would like to insert a row into a table of my database with the inputs of a form and the logged in user’s email but i only get a white screen after i click the submit button. does someone see the mistake in my controller?
<?php
use Uniform\Form;
return function ($kirby, $page, $pages) {
$form = new Form([
...
]);
if ($kirby->request()->is(‘POST’)) {
$data = [
...
];
try {
$bool = Db::insert('table', [
'email' => $kirby->user()->email(),
'url' => $page->url(),
'column' => $data['input']
]);
dump($bool);
go('/');
} catch (Exception $e) {
$error = true;
}
}
(the topic before contained unnecessary code, so i deleted it. sorry for the spam!)
if someone has some experience with connecting kirby and databases, that would be great!
sigi