import <Google/Analytics.h>
我收到错误:
在...
中的非对象上调用成员函数fetch_assoc()
答案 0 :(得分:1)
<?php
$conn = new mysqli($servername, $username, $password, $dbname);
/* check connection */
if ($conn->connect_errno) {
printf("Connect failed: %s\n", $conn->connect_error);
exit();
}
$sql = "SELECT Nr FROM AlleTransaktionen1";
$my_money = 0;
if ($result = $conn->query($sql)) {
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
printf ($row["Nr"]);
}
/* free result set */
$result->free();
}
/* close connection */
$mysqli->close();
?>