$str=file_get_contents($files[0]);
$str = str_replace("mysqli_query(''","mysqli_query($db,",$str);
$file_handle = fopen($files[0], "w");
fwrite($file_handle, $str);
fclose($file_handle);
$str = str_replace( "mysqli_query(''", 'mysqli_query($db,', $str );