CMS Development Wordpress

Update/insert only a column of database table

I WordPress table named wp_fes_vendors, there is a total of 12 columns.

Out of these 12 columns, I want to only update the data of column name requests

The data i am getting for this column is from a custom form in backend stored in $_POST['getval']

Here is code i tried

 if (!empty(isset($_POST['getval'])))
            global $wpdb;

            $data_array = array(

            'requests' => $_POST['getval']


            $data_where = array('requests' => $_POST['getval']);




<form id="myForm" name="myform" action="" method="POST" style="padding:20px;">
  <label> Select if this Vendor wishes to receive customer requests or not: </label>
  <select name="getval" id="brandSel" size="1">
      <option selected="selected" disbaled value="">-- Select status --</option>
      <option value="1">Enable</option>
      <option value="0">Disable</option>

  <?php submit_button('submit'); ?>

I tried several times but the data is not being saved /updated.
Here is picture of db

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *