I want to check if some column of specify user is holding a value higher than 0.
Problem
When doing the query, and then executing it
try this:
$sql = "SELECT * FROM admin WHERE username = ?"; $stmt = $CONNECT_TO_DATABASE->prepare($sql); $stmt->execute(array($_SESSION['user'])); $admin = $stmt->fetch(); if($admin) { //do something if query returns row(s) }