Jump to content

So quick question, I am trying to check a value in a mysql database with php and just a simple check to see if it is at least a certain value, whats a good way to do this? 

 

Thanks

 

	<?php 
    require("common.php"); 
    if(empty($_SESSION['user'])) 
    { 
        header("Location: login.php");
		exit("redirect: login.php");
    } else {
		 $query = " 
        SELECT 
            id, 
            username, 
            email,
			first,
			last,
			access_level
        FROM users 
    "; 
	}
	if($_SESSION['access_level'] <= 10)
	{
		exit("Access allowed");
		
	} else{
		header("Location: index.php");
		exit("redirect: index.php");
	}
?> 
<html>
<head>
<meta charset="utf-8">
<title>level 10 test</title>
</head>
<body>
	<p> level 10 test</p>
</body>
</html>

 

Link to comment
https://linustechtips.com/topic/973466-using-php-to-target-mysql-vlaue/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×