function update($data, $table, $id)
{
global $conid;
//echo $id;
/*Assuming array keys are = to database fileds*/
if (count($data) > 0) {
foreach ($data as $key => $value) {
$value = mysqli_real_escape_string($value); // this is line shows a warning
$value = "'$value'";
$updates[] = "$key = $value";
}
}
$implodeArray = implode(', ', $updates);
$sql = ("UPDATE $table SET $implodeArray WHERE id=$id");
mysqli_query($conid, $sql);
}
This is update code for all forms but it gives a warning. warning shows only in that line other works perfectly i didn't find why this happen..