我有
$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
)
我尝试了很多不同的事情,但没有成功。我会怎么做?