getadmacc.php 546 B

123456789101112131415161718
  1. <?php
  2. $res=mysqli_query($link,'SELECT * FROM Admins WHERE ID='.$_SESSION['AdmID'])
  3. or muoribene(mysqli_error($link),true);
  4. if (mysqli_num_rows($res)==1) {
  5. $account=mysqli_fetch_assoc($res);
  6. if ($account['Level']=='guest') {
  7. $res=mysqli_query($link,'SELECT ID FROM Instances WHERE GuestID='.$account['ID'])
  8. or muoribene(mysqli_error($link),true);
  9. $account['Insts']=array();
  10. while ($row=mysqli_fetch_assoc($res))
  11. $account['Insts'][]=$row['ID'];
  12. }
  13. } else {
  14. muoribene('Non esiste un account con ID='.$_SESSION['AdmID'],true);
  15. }
  16. ?>