02-15-2018, 12:43 PM
Here's a more detailed answer. Generally when you're inserting, you don't want to let people set the id field, so you can tell generateAddForm to skip it by doing this. (I'm choosing MQTT because it's a table you're not going to break by inserting random data)
Then you can actually process the form somewhat automatically.
//if you want to see what you have at this point...
//dnd($fields);
//do any checks you want to do here.
Code:
<?php generateAddForm('mqtt',['id']);?>
Then you can actually process the form somewhat automatically.
Code:
if(!empty($_POST)){
Code:
$fields = updateFields2($_POST);
//dnd($fields);
//do any checks you want to do here.
Code:
$db->insert('mqtt',$fields);
Code:
bold("<br>New row inserted!");
Code:
}