不要只使用php和sql来做你想做的事情。你需要ajax。你需要了解这一点,或者试试我的前两个建议。 $results = mysqli_query($con,"SELECT * FROM email_list"); echo "<table>

不要只使用php和sql来做你想做的事情。你需要ajax。你需要了解这一点,或者试试我的前两个建议。 $results = mysqli_query($con,"SELECT * FROM email_list"); echo "<table>,php,mysql,Php,Mysql,不要只使用php和sql来做你想做的事情。你需要ajax。你需要了解这一点,或者试试我的前两个建议。 $results = mysqli_query($con,"SELECT * FROM email_list"); echo "<table>"; while($row2 = mysqli_fetch_array($results)) { echo"<tr>"; echo "<td>" . $row2['email_idno'] . "</td>

不要只使用php和sql来做你想做的事情。你需要ajax。你需要了解这一点,或者试试我的前两个建议。
$results = mysqli_query($con,"SELECT * FROM email_list");
echo "<table>";
while($row2 = mysqli_fetch_array($results))
{
echo"<tr>";
echo "<td>" .  $row2['email_idno'] . "</td>";
echo "<td>" .  $row2['email_email'] . "</td>";
echo "<td>" .  $row2['email_name'] . "</td>";   
echo"</tr>";            
}
echo "</table>";    
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>title</title>
        <link rel="stylesheet" href="style.css">
        <script src="jquery.js"></script>
    </head>
    <script>
    $(document).ready(function()
    {
        iOffset = 0;
        function callEndpoint( call_url, payload ){
            return $.ajax({
                url: call_url,
                type: 'GET',
                data: payload
            });
        }
        function loadRows() {
            iLimit  = 10;
            oRequest = callEndpoint( '/play/endpoint2.php', { 'offset': iOffset, 'limit': iLimit } );
            oRequest.done(function( sJson ) {
                aRaw = JSON.parse( sJson );
                        console.log( aRaw );
                aData = aRaw.data;
                if( jQuery.isEmptyObject( aData ) )
                {
                    console.log( 'empty!! ' );
                    clearInterval( t );
                }
                else
                {
                    sNewRows = '';
                    for ( var i = 0; i < aData.length; ++i ) {
                        sNewRows += '<tr>';
                        for ( var prop in aData[ i ] ) {
                            if( aData.hasOwnProperty( prop ) ){
                                sNewRows += '<td>' + aData[ i ][ prop ] + '</td>';
                            }
                        }
                        sNewRows += '</tr>';
                    }

                    $( '#loading-data tr:last' ).after( sNewRows );
                    iOffset += 10;
                }
            });
        }
        loadRows();
        var t = setInterval(function(){
            loadRows();
        },2000); // Load more rows every 2 seconds.
    });
    </script>
    <body>
        <table id="loading-data">
            <tbody>
                <thead>
                    <tr>
                        <th>PK</th>
                        <th>co</th>
                        <th>type</th>
                        <th>num</th>
                    </tr>
                </thead>
            </tbody>
        </table>
    </body>
</html>
class MySql
{
    private $sDbName      = 'play';
    private $sUsername    = 'root';
    private $sPassword    = '';
    private $sHost        = 'localhost';
    private $oConnection  = null;

    public function __construct()
    {
        $this->oConnection = new PDO( 
            'mysql:host=' 
            . $this->sHost 
            . ';dbname=' 
            . $this->sDbName, 
            $this->sUsername, 
            $this->sPassword 
            );
    }
    public function getDb()
    {
        return $this->oConnection;
    }
}
$oMySql = new MySql;
$oDb = $oMySql->getDb();

$aGet = $_GET;
if( !empty( $aGet ) )
{
    $iOffset = $aGet[ 'offset' ];
    $iLimit  = $iOffset + $aGet[ 'limit' ];
}

$sSql = "
    SELECT pk, companyId, type, page_nav
    FROM
    `1`
    WHERE
    pk >= :custom_offset
    AND 
    pk < :custom_limit
    ";
$oStmp = $oDb->prepare( $sSql );

$oStmp->bindValue( ':custom_offset', $iOffset );
$oStmp->bindValue( ':custom_limit', $iLimit );
$oStmp->execute();
$aResults = $oStmp->fetchAll();
// var_dump( $aResults );
$oErrors = $oStmp->errorInfo();
// var_dump( $oErrors );

$aReturn[ 'data' ] = $aResults;
$sJson = json_encode( $aReturn, 1 );
header( 'Content-type', 'application/json' );
echo $sJson;