Query MySQL for permissions in PHP -
I have a site where a user can have multiple permissions (see, edit, delete, create). Each of these is stored in the database as a tint (1) field.
I see that the user has the ability to view this page, Here's a snippet:
$ user = mysql_real_escape_string ($ user); $ Resultset = mysql_query ("selectionback testbankAccess where UID $ user"); While ($ result = mysql_fetch_row ($ resultset)) {if ($ result [0] == '1') {Back true; } } return false;
$ resultset = mysql_query ("Check with checkbackbackback access where UID = $ User LIMIT 1 "); $ Result = mysql_fetch_row ($ resultet) if ($ result [0] == 1) {back true; }
I think it can not be fast (almost nothing is happening there) unless the UID is a key in your table.
Comments
Post a Comment