目前我的文件結構看起來像這樣,一切工作正常。 但在我的home.php中,我想能夠拉出數組的一部分,例如用戶圖像。PHP函數OOP陣列拉
$connect->LoadInformation->image
我該怎麼寫,或者改變我的代碼以使其工作?我真的希望這是有道理的。
home.php
$connect->LoadInformation($_COOKIE['steamID']);
class.php
public function LoadInformation($steamID){
$query = "SELECT * FROM user WHERE steamid = '$steamID'";
$results = $this->con->get_results($query);
echo "<pre>";
print_r($results);
echo "<pre>";
}
電流輸出
Array
(
[0] => Array
(
[id] => 10
[steamid] => 76561198026169223
[profilestate] => 0
[steam_user] => Dz - Lol u mad?
[online] => 0
[signup] => 2014-01-05 17:28:15
[image] => http://media.steampowered.com/steamcommunity/public/images/avatars/b8/b85a568b25210a27a8413e4dc05c9f42a7cdaf22.jpg
[description] =>
[active] => 0
[admin] => 0
)
)
無關,與OOP和開放的SQL注入。 – PeeHaa