I have a table named 'species' with 3 columns: id, specie, rate.
And I have tried using the following query but it throws the errors:
Fatal error: Uncaught Error: Call to a member function insert() on null in D:\Wordpress\....includes\specie_form.php on line 10
Error: Call to a member function insert() on null in D:\Wordpress.....includes\specie_form.php on line 10
Query
$specie_name= $_POST['specie_name'];
$specie_rate=$_POST['specie_rate'];
global $wpdb;
$wpdb->insert('species', array( //this is line 10 of error
'id' => NULL,
'specie' => '$specie_name',
'rate' => '$specie_rate'
));