概述:这是一个广泛的问题,因为我花了很多时间尝试调试它并在线查找帮助。我看过几个网站说要通过命令行向用户授予权限来访问MySQL,但它们似乎不起作用。
问题:Apache可以与数据库连接并将数据插入其中,但无法从select等内容中检索数据。
这是配置问题吗?我正在努力寻找答案。它适用于Windows,但不适用于Linux。
75.83.167.113 - - [17/Jun/2016:23:58:28 -0400] "POST /?base=main &page=vote HTTP/1.1" 500 3447 "http://www.dynastyms.net/?base=ma in&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/ 537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
75.83.167.113 - - [17/Jun/2016:23:58:28 -0400] "GET /?base=main& page=vote HTTP/1.1" 200 4584 "http://www.dynastyms.net/?base=mai n&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/5 37.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
66.249.66.138 - - [17/Jun/2016:23:58:32 -0400] "GET /?base=main&page=rankings&job=pirate&start=1260 HTTP/1.1" 200 6024 "-" "Mozilla/5.0 (cible; Googlebot/2.1; +http://www.google.com/bot.html)"
75.83.167.113 - - [17/Jun/2016:23:58:54 -0400] "GET /?base=main&page=rankings HTTP/1.1" 200 7159 "http://www.dynastyms.net/?base=main&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
75.83.167.113 - - [17/Jun/2016:23:58:54 -0400] "GET /?base=main&page=vote HTTP/1.1" 200 4584 "http://www.dynastyms.net/?base=main&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
75.83.167.113 - - [17/Jun/2016:23:58:55 -0400] "GET /?base=main&page=vote HTTP/1.1" 200 4584 "http://www.dynastyms.net/?base=main&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
75.83.167.113 - - [17/Jun/2016:23:58:58 -0400] "POST /?base=main&page=vote HTTP/1.1" 500 3447 "http://www.dynastyms.net/?base=main&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
75.83.167.113 - - [17/Jun/2016:23:58:58 -0400] "GET /?base=main&page=vote HTTP/1.1" 200 4584 "http://www.dynastyms.net/?base=main&page=vote" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
66.249.66.142 - - [17/Jun/2016:23:59:06 -0400] "GET /?base=main&page=rankings&job=aran&start=1290 HTTP/1.1" 200 6020 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.66.142 - - [17/Jun/2016:23:59:06 -0400] "GET /?base=main&page=rankings&job=magician&start=1245 HTTP/1.1" 200 6028 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
66.249.66.138 - - [17/Jun/2016:23:59:29 -0400] "GET /?base=main&page=rankings&job=beginner&start=1260 HTTP/1.1" 200 6028 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
PHP错误
[Sat Jun 18 00:02:57 2016] [error] [client 75.83.167.113] PHP Fatal error: Call to a member function fetch_assoc() on a non-object in /var/www/html/dynasty/sources/public/vote.php on line 29, referer: http://www.dynastyms.net/?base=main&page=vote
发生错误的行:
$result = $mysqli->query("SELECT *, SUM(times) as amount FROM votingrecords WHERE NOT account='' AND NOT account='0' AND account='".$account."' AND siteid = '".$siteid."'"); // or die('Error - Could not look up vote record!');
$row = $result->fetch_assoc();