PHP and Mysql

session_start();
$con=mysql_connect('localhost','root','root') or die('链接数据库失败!');
mysql_query('set names utf8');
mysql_select_db('dbName');


## select

$sql = "SELECT * FROM tab WHERE ";
$numRecord = mysql_num_rows(mysql_query($sql));

$pagesize = 10;
$totalpage = ceil($numRecord/$pagesize);
$recordSql = $sql. " LIMIT ".$page*$pagesize.",".$pagesize;
$result = mysql_query($recordSql);


while($rs=mysql_fetch_object($result)){
    echo $rs->id
    echo date("Y-m-d H:i:s",$rs->revert_time+8*3600)
}


## insert

## delete

## update


你可能感兴趣的:(mysql)