Sup yo
I'm doing an admin panel (not habbo related fuck)
and i need to show some content based on user's permission level, like 1 2 3 or 4 or whatever. (btw im usin xampp rn)
My Php code below:
I'm doing an admin panel (not habbo related fuck)
and i need to show some content based on user's permission level, like 1 2 3 or 4 or whatever. (btw im usin xampp rn)
My Php code below:
PHP:
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "lumino";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT permission FROM users WHERE username = 'Berkay'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
}
}
$permission = $row["permission"];
?><?php if($permission >= 1) { echo'<li class="parent"><a href="usermanagement.php"><i class="fa fa-users" aria-hidden="true"></i> User Management</a></li> ';} ?>