php - Redirect if Database has a certain value -


okay, so, php page connected database.

let's have database, , within database there table called users.

the users table has 2 columns. username , voted.

i want php query says if "username" has "0" on voted, redirects them page. if voted has "1" doesn't redirect them , begin go along day.

you can check if username has 0 on voted using sql syntax

if, condition true use header() like:

$voted = // value database connection if ($voted == 0) {     header("location: somewhere/page");     exit(); } 

Comments