My query does not insert data multiple time

by Sanjay Yadav   Last Updated October 09, 2017 16:08 PM

I am trying to insert data on current user based. but data insert one time. when insert data second time .data does not inserted.i am working on web services. so all data checking from postman.

<?php

require('../../../../wp-blog-header.php');
header("HTTP/1.1 200 OK");
global $wpdb;
global $serverUrl;
$id =isset($_server['store_id']) ? $_server['store_id'] : '';
$user_id =isset($_server['user_id']) ? $_server['user_id'] : '';
$unit_data = isset($_server['unit_data']) ? $_server['unit_data'] : '';
$name = isset($_server['name']) ? $_server['name'] : '';
//$option = "signup";
$data = array(    
    'store_id' =>$id, 
         'user_id'=>$user_id,
    'unit_data' =>$unit_data,
        'name' =>$unit_data,   
    );   
    $insert=$wpdb->insert('dairy_user_form_storage', $data);    
        if($insert){
            echo "data inserted ";   
        }
        else{
            echo 'please solve the eroor';
        }
}


Related Questions


can we use post type as a category?

Updated July 31, 2016 08:03 AM

Where can I find my Wordpress web host

Updated May 12, 2017 21:08 PM


Wordpress Webservices With Json Encode

Updated January 05, 2018 12:08 PM

000webhost phpMyadmin login error

Updated April 03, 2016 08:03 AM