Is it possible to restrict access to a page using a recordset?

There is a list and detail page for a table 'score overview'. Basically I want to have it so if a person is on the list page, they can't go to the detail page because of the WHERE clause only if a certain criteria has been met.

WHERE score_overview.chaplain_review = '1'

I just don't know how to restrict a user from being able to update (or view) a record if the chaplain review is equal to 1.

Thanks in advance.

Try the below code and adjust the mysql query accordingly to your database design:

$access=mysql_query("SELECT * FROM `table` WHERE `column name` = '1'");
if (mysql_num_rows($access)!==0)
    {
    //Insert here data they can only view if the mysql column value = 1
    //You could also just place here "exit;" without the quotes the skip
    //all code below.
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.