我對PHP和MySQL都很陌生。PHP和MySQL用戶帳戶
我只開始學習它們來運行遊戲服務器。
我遇到了在Apache的錯誤日誌descriped的問題:
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Notice: Undefined variable: db in C:\Program Files\VertrigoServ\www\sw_game_login.php on line 24
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Stack trace:
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP 1. {main}() C:\Program Files\VertrigoServ\www\sw_game_login.php:0
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Fatal error: Call to a member function fetch_row() on null in C:\Program Files\VertrigoServ\www\sw_game_login.php on line 24
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP Stack trace:
[Mon Sep 04 01:00:16.928467 2017] [:error] [pid 3656:tid 784] [client 127.0.0.1:49401] PHP 1. {main}() C:\Program Files\VertrigoServ\www\sw_game_login.php:0
線sw_game_login.php 24如下所示:
if(list($id)=$db->fetch_row($db->query("SELECT ID FROM accounts WHERE ACCOUNT_NAME='$account' AND ACCOUNT_PASSWORD='$pass'"))){
我從遊戲中收到的錯誤客戶說,不正確的帳戶或密碼,我知道這是不是我已經嘗試了幾次,並檢查了幾次。因此導致我相信,也許請求沒有正確發送。
在此先感謝任何幫助!
也許我們應該在輸入驗證/消毒時講授輸入驗證/消毒? :) –