The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Empty Form Field Validation? Reply To: Empty Form Field Validation?


I can connect to the database the problem happens when trying to insert.

This first error :

Fatal error: Call to undefined function connect() on line 34 which is :

$DB = connect();

If I remove it I then get :

Notice: Undefined variable: DB on line 38 Fatal error: Call to a member function prepare() on a non-object on line 38

$stmt = $DB->prepare( $SQL );

This is using your connectPDO.php file to connect to the database. I get the same errors using my connect script.

I’ve spent more time getting the damn form to validate than all the other code combined. It should be simple to display errors for empty fields regardless of what code is used.