Skip to main content
Commonmark migration
Source Link

I used "wpdb" in my code But it was not working and the following error:

Fatal error: Call to a member function insert() on a non-object

 

Notice: Trying to get property of non-object" in tablename = $wpdb->prefix.'complaint';

global $wpdb;
    $name = $_POST["name"];
    $email = $_POST["email"];
    $dis = $_POST["dis"];
    $code = $_POST["code"];
    
function insert_record_to_db($name,$email,$dis){
    global $wpdb;
$tablename = $wpdb->prefix.'complaint';
    $data=array( 
            'name' => '$name',
            'email' => '$email',
            'dis' => '$dis'
        );
    $format= array('%s','%s','%s');
    
    $wpdb->insert( $tablename , $data , $format );
};
insert_record_to_db($name,$email,$dis);

I used "wpdb" in my code But it was not working and the following error:

Fatal error: Call to a member function insert() on a non-object

 

Notice: Trying to get property of non-object" in tablename = $wpdb->prefix.'complaint';

global $wpdb;
    $name = $_POST["name"];
    $email = $_POST["email"];
    $dis = $_POST["dis"];
    $code = $_POST["code"];
    
function insert_record_to_db($name,$email,$dis){
    global $wpdb;
$tablename = $wpdb->prefix.'complaint';
    $data=array( 
            'name' => '$name',
            'email' => '$email',
            'dis' => '$dis'
        );
    $format= array('%s','%s','%s');
    
    $wpdb->insert( $tablename , $data , $format );
};
insert_record_to_db($name,$email,$dis);

I used "wpdb" in my code But it was not working and the following error:

Fatal error: Call to a member function insert() on a non-object

Notice: Trying to get property of non-object" in tablename = $wpdb->prefix.'complaint';

global $wpdb;
    $name = $_POST["name"];
    $email = $_POST["email"];
    $dis = $_POST["dis"];
    $code = $_POST["code"];
    
function insert_record_to_db($name,$email,$dis){
    global $wpdb;
$tablename = $wpdb->prefix.'complaint';
    $data=array( 
            'name' => '$name',
            'email' => '$email',
            'dis' => '$dis'
        );
    $format= array('%s','%s','%s');
    
    $wpdb->insert( $tablename , $data , $format );
};
insert_record_to_db($name,$email,$dis);
deleted 25 characters in body
Source Link

I used "wpdb" in my code But it was not working and the following error:

Fatal error: Call to a member function insert() on a non-object

Notice: Trying to get property of non-object" in tablename = $wpdb->prefix.'complaint';

global $wpdb;
    $name = $_POST["name"];
    $email = $_POST["email"];
    $dis = $_POST["dis"];
    $code = $_POST["code"];
    
function insert_record_to_db($name,$email,$dis){
    global $wpdb;
$tablename = $wpdb->prefix.'complaint';
    $data=array( 
            'name' => '$name',
            'email' => '$email',
            'dis' => '$dis'
        );
    $format= array('%d','%d','%d','%d','%s','%s','%s','%s');
    
    $wpdb->insert( $tablename , $data , $format );
};
insert_record_to_db($name,$email,$dis);

I used "wpdb" in my code But it was not working and the following error:

Fatal error: Call to a member function insert() on a non-object

Notice: Trying to get property of non-object" in tablename = $wpdb->prefix.'complaint';

global $wpdb;
    $name = $_POST["name"];
    $email = $_POST["email"];
    $dis = $_POST["dis"];
    $code = $_POST["code"];
    
function insert_record_to_db($name,$email,$dis){
    global $wpdb;
$tablename = $wpdb->prefix.'complaint';
    $data=array( 
            'name' => '$name',
            'email' => '$email',
            'dis' => '$dis'
        );
    $format= array('%d','%d','%d','%d','%s','%s','%s','%s');
    
    $wpdb->insert( $tablename , $data , $format );
};
insert_record_to_db($name,$email,$dis);

I used "wpdb" in my code But it was not working and the following error:

Fatal error: Call to a member function insert() on a non-object

Notice: Trying to get property of non-object" in tablename = $wpdb->prefix.'complaint';

global $wpdb;
    $name = $_POST["name"];
    $email = $_POST["email"];
    $dis = $_POST["dis"];
    $code = $_POST["code"];
    
function insert_record_to_db($name,$email,$dis){
    global $wpdb;
$tablename = $wpdb->prefix.'complaint';
    $data=array( 
            'name' => '$name',
            'email' => '$email',
            'dis' => '$dis'
        );
    $format= array('%s','%s','%s');
    
    $wpdb->insert( $tablename , $data , $format );
};
insert_record_to_db($name,$email,$dis);
deleted 17 characters in body; edited tags
Source Link
deleted 17 characters in body
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209
Loading
Source Link
Loading