astralsin Posted June 7, 2007 Share Posted June 7, 2007 Anyone know how to show what users have permission to a mysql database a la cPanel? Quote Link to comment https://forums.phpfreaks.com/topic/54665-showing-user-permissions-from-a-database/ Share on other sites More sharing options...
DJTim666 Posted June 7, 2007 Share Posted June 7, 2007 Well, if a user has permission to a database the easiest way to show it would be; Go to the users(or w.e the name is in ur DB) table, add a column named "permission", VARCHAR 10 not null. This should be added to the table when they sign-up or you can do it manually. So it should look something like this to call the permission from the table. <?php mysql_query("SELECT `permission` FROM `users` WHERE `user`='(session or cookie variable)'") or die (mysql_error()); ?> The result from the would be; Username- Permission- yes/no etc- etc- Thats about it. Hope this helped you a little ! -- DJ Quote Link to comment https://forums.phpfreaks.com/topic/54665-showing-user-permissions-from-a-database/#findComment-270340 Share on other sites More sharing options...
astralsin Posted June 8, 2007 Author Share Posted June 8, 2007 well, thats not quite what i had in mind. i'm trying to develop a mysql frontend that allows you to easily add/delete users, databases, and add users to databases. i'd really like to show the permissions that each user has on each database much like cPanel's MySQL interface. This information is held in the mysql database and it wouldnt be feasible to add an extra column to every database to show whether a user has permissions, besides, i'd like to show exactly what grants that user has. Quote Link to comment https://forums.phpfreaks.com/topic/54665-showing-user-permissions-from-a-database/#findComment-270691 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.