I'm developing my first wordpress plugin where I can list all my employees with some CRUD functionality.
When I click "Add Employee" I get a new window where I can fill in all the fields for an employee and after that I click "Save"
But when I click save I get the following PHP error:
Fatal error: Call to a member function insert() on a non-object in C:\wamp\www\wp-custom-plugin\wp-content\plugins\werknemers\employee_crud_functions.php on line 15
And when I look at line 15 the code is:
$wpdb->insert( ... )
and this is my form with the action set to that php page
<form method="POST" action="<?php bloginfo('url') ?>/wp-content/plugins/werknemers/employee_crud_functions.php">
I assume that the file is not aware of the $wpdb variable. But how can I let that php page know what it is? Or am I using it all wrong?