无法列出PHP和MySQLi中表中的所有记录 [英] Unable to list all records from the table in PHP and MySQLi
本文介绍了无法列出PHP和MySQLi中表中的所有记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?php
require( '../connect_db.php' ) ;
$query = $dbc->query('SELECT * FROM customer');
while($row = $query->fetch(PDO::FETCH_ASSOC)) {
echo $row['clientid'].' '.$row['inital'].' '.$row['firstname'].' '.$row['lastname'].' '.$row['mobile'].' '.$row['landline'].' '.$row['email'].' '.$row['address'].' '.$row['postcode'].' '.$row['accessibility'];
}
?>
但是给了我一个致命错误:在第13行的list_customer.php中调用未定义的方法mysqli_result :: fetch()
推荐答案
Mysqli没有方法fetch,您可能是说fetch_assoc()
Mysqli doesn't have method fetch, you probably meant fetch_assoc()
这篇关于无法列出PHP和MySQLi中表中的所有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文