目前我的文件结构看起来像这样,一切工作正常。 但在我的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