get_data.php

来自「php绿色服务器,让大家试用greenamp」· PHP 代码 · 共 23 行

PHP
23
字号
<?
    function showData() 
    { 
        //make your query here that selects all your data for the grid 
        //you have to modify the $res and fetch yourself to make the query succesfull 
        $res = $this->dbi->query('your query here'); 
                 
        while($obj =& $this->dbi->fetch())                 
        { 
            $arr[] = $obj;  
        } 
        //encode your data for the jsonreader 
        echo $_GET['callback'].'({"total":"'.$rows.'","results":'.json_encode($arr).'})'; 
    } 

    function saveData() 
    { 
        $data = json_decode(stripslashes($_POST['data'])); 
         
        //make here a query that updates the database 
    }  
    
    ?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?