Scroll to top

How to update data in database in wordpress?

<?php

if(isset($_POST[“submit”])){
extract($_POST);
$parametername = $_POST[‘parametersname’];

$id = 4;
/***** updating user *****/
$userstable = $wpdb->prefix . “apindt_parameters”;

$where = array(
‘ID’ => $id
);

$wpdb->update( $userstable,
array(
‘parameters_name’ => $parametersname,
‘wet’ => $wet,
‘dry’ => $dry,
‘ac’ => $ac,
‘dc’ => $dc,
‘bench_sn’ => $benchsn,
‘bench_mfg’ => $benchmfg,
‘bench_model’ => $benchmodel,
),

$where);

}

?>

Leave a Reply

Your email address will not be published.