i have a tables eligibility and venue.eligibility table have multiple records i am passing using dynfields array for inserting data below is the code for inserting.Now i want to update the data.how can i do that.please help me thanks in advance.
$job_id = mysql_insert_id();
if ($_POST['dynfields']) {
foreach ( $_POST['dynfields'] as $key=>$fieldArray ) {
$keys = array_keys($fieldArray);
$values = array_map("mysql_real_escape_string",$fieldArray);
$query = mysql_query("INSERT INTO `sk_c_eligibility` (".implode(',',$keys).",elg_job_id) VALUES ('".implode('\',\'',$values)."','$job_id')") or die(mysql_error());
}
}
What I have tried:
now i am trying to update those fields using like this.i dont know whether it should work or not .please help me.thanks in advance.
$job_id = mysql_insert_id();
if ($_POST['dynfields']) {
foreach ( $_POST['dynfields'] as $key=>$fieldArray ) {
$keys = array_keys($fieldArray);
$values = array_map("mysql_real_escape_string",$fieldArray);
$query = mysql_query("UPDATE`sk_c_eligibility` SET (".implode(',',$keys).",elg_job_id) VALUES ('".implode('\',\'',$values)."','$job_id')") or die(mysql_error());
}
}