我正在使用此代码从我的数据库中提取数据,但它无法正常工作。有什么想法吗?
Code:
<?php
$db = new mysqli($host,$user,$pass,$name);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT * FROM Sublist WHERE 1 LIMIT 0 , 30";
$result = $mysqli->query($query);
while($info = mysql_fetch_array($query, MYSQL_ASSOC)) {
echo $info['scheduled_date'];
echo "<br>";
echo $info['customer_name'];
echo "<br>";
echo $info['status'];
echo "<br>";
echo $info['kaspersky_template'];
echo "<br>";
echo $info['pcpickup_template'];
}
?>
错误代码:致命错误:在第20行的/home/projectu/public_html/sub/scheduled.php中调用非对象的成员函数query()
答案 0 :(得分:2)
你不是说
$result = $db->query($query);
其次是
while ($info = mysqli_fetch_array($result)) {