I have created a new file inside wp-content/theme/mytheme folder.
Inside the file I have written simple query
global $wpdb;
$insert= $wpdb->insert('wp_test', array(
'orderID' =>$_GET['orderID'],'amount'=>$_GET['amount'],'acceptance'=>$_GET['ACCEPTANCE'],'status'=>$_GET['STATUS'],
));
I am getting error "Call to undefined function". Do I have to include file inside this file?
According to this document : https://codex.wordpress.org/Class_Reference/wpdb
you must change your code to this:
By these ways , You can do it easily,
First define $wpdb globally as like
global $wpdb;
Second Way is
Third is
If you are beginner then read more here https://codex.wordpress.org/Class_Reference/wpdb
Try this : include wp-load.php at beginning of file.
File is located at theme folder.