包含connect.php文件的写法以及循环输出查询结果

包含connect.php文件的写法以及循环输出查询结果

我们先把代码写在下面:

require_once("./connect.php");

$sql="select * from userone order by id asc";

$result=mysqli_query($link,$sql);

$arrs=mysqli_fetch_all($result,MYSQLI_ASSOC);

$records=mysqli_num_rows($result);

?>

account statistics


account statistics

there are data add data

idsortcategorizewebsiteaccountpasswordremarkaction options
revise | delete

在写这个代码的时候,我出现了三处错误:

第一处:

require_once("./connect.php");这里老是忘记加引号。

第二处:

这里的mysqli_assoc是指定结果集关联的数据库中取出一行,这一行数据是关联数组。

第三处:

这里的循环数组忘记加echo。