Featured Replies in this Discussion

I think you need the conditional in order to evaluate the result from the function, don't you? ... Echo the SQL string to the screen. Highlight and copy it to the clipboard and paste it to the SQL window in phpmyadmin. Run it, see what it gives.

I don't see why you are using an if statement again, it was already called in the function. What basically happens in your if statement is that you check if the function was called, which it was, hence all admin returns. Just call the function..

<?php
isitadmin($user_id)
?>

Rather put the code what you want to do with an admin in your function where it returns 1 or more rows...

I need isitadmin to return value that confirm this user is admin so it will show some buttons or can access to diffrent areas so I must put true of false as return,
I've tried to call function and tried to put "1" as return and now nothing appears to admin or user

I was having problem with $user_id so always its an error , because the $user_id was taking from files uploader not from session so after I edited the $user_id source it solved my problem, thanks for @diafol for this advice by echo the $sql. SOLVED.