I've got one table called books in my database. I've got users who are admin and not admins have boolean 0 assigned to them, so I have a function but I only want admins to be able to execute the function.
Therefore I need to check the database with their username and whether they are admins that is type==0 or not. I have to do this all in PDO statements.
$sqls =$handle->prepare("SELECT type FROM 888 WHERE 888='{$_COOKIE['888']}'");
$sqls->execute();
$row = $sqls -> fetch();
if($row['type']==0){do the function}
yet it does not show any error or anything else. Can you see and explain the problem?