<?php
    error_reporting(E_ALL & ~E_NOTICE); 
    ini_set("display_errors", 0);
    include 'mysql.class.php';
    If(Isset($_POST['sql'])){
        $sql =$_POST['sql'];
		$mysql_s = new mysql();
		$conn =$mysql_s->construct("此处填写数据库IP加端口，例如localhost:3306或192.168.0.1:3306等等",
                                    "此处填写用户名，例如root",
                                    "此处填写密码，例如1234567",
                                    "此处填写数据库名称，例如test",
                                    rand(0, 32000),
                                    "utf8");
        $fh = $mysql_s->query($sql ); 
        $a = array();
        $count = 0;
        while($row = mysql_fetch_array($fh))
        {
            $a[$count] = $row;
            $count = $count + 1;
        }        
        echo json_encode(array("queryString"=>$sql,"data"=>$a));
    }else{
        echo json_encode(array("data"=>null));
    }
?>
