Custom tables and using wpdb to insert into DB from a html form

You’re using a placeholder (“%s”) in your SQL for prepare, but you don’t pass it a value to put in place of that placeholder, hence the complaint.

use $wpdb->prepare("SELECT ... %s", $myvalue)

And I’m pretty sure your other error stems from you passing in a DateTime object. $wpdb will not convert that automatically, it expects strings, which it then passes to mysql_real_escape_string() (or mysqli_real_escape_string() depending on what the connection is set up with).

Side note: you might want to overthink using special chars in variable names. If somebody who doesn’t use your language’s keyboard layout ever needs to edit that script, he’ll have a fun time copy pasting æ in variables 🙂