php获取数据库前10条记录

<?php
header("Content-type: text/html; charset=utf-8");
include('./config.php');
$sql = "SELECT id, shuoshuo FROM shuoshuo ";
$result = mysqli_query($conn, $sql);
$data= mysqli_fetch_all($result);
for ($a=0;$a<10;$a++)
{
echo $data["$a"][0].$data["$a"][1];
}
?>

THE END
分享
二维码
< <上一篇
下一篇>>