0
$query = "SELECT
PrivilageName,
PrivilageExp,
'true' hakkivarmi
FROM users
natural join usermemberships
natural join groupprivileges
natural join `privileges`
where UserID = '2' ";
$result = mysqli_query($link, $query);
$rows = Array();
while($row = mysqli_fetch_assoc($result)) {
array_push($rows, $row);
}
print_r($rows);exit;
而且它打印出
Array
(
[0] => Array
(
[PrivilageName] => AddBuilding
[PrivilageExp] => Bina Ekleme
[hakkivarmi] => true
)
[1] => Array
(
[PrivilageName] => RemoveBuilding
[PrivilageExp] => Bina Silme
[hakkivarmi] => true
)
[2] => Array
(
[PrivilageName] => EditBuilding
[PrivilageExp] => Bina Düzenleme
[hakkivarmi] => true
)
)
而且我要的是
Array
(
AddBuilding => true
RemoveBuilding => true
EditBuilding => true
)
我已經嘗試了許多不同的事情,但沒有成功。我該怎麼做?