php authentication with mysql privileges

hi
I set an authentication in php for admin and it worked fine but now I need to use the same code for users who have limited access to the database that the admin use.
user1 only update one table
user2 only view tables
user3 insert to one table only
Do i need to use the mysql priviledge to limit the access of the users?if so how?
or I can use php code that have the same effect as the mysql privileges:idea:.
my authentication page is:

Usually you can use a session to denote the user level (e.g. 1,2,3). You can use this to determine which pages can be viewed etc. You can use different mysql accounts based on the session user level. I suggest you NEVER use your superadmin account for connection in a site. Drill down to the minimum privileges for the account.

You can also have a second login screen to access admin pages. May be overkill though. phpBB operate a similar method.

Usually you can use a session to denote the user level (e.g. 1,2,3). You can use this to determine which pages can be viewed etc. You can use different mysql accounts based on the session user level. I suggest you NEVER use your superadmin account for connection in a site. Drill down to the minimum privileges for the account.

You can also have a second login screen to access admin pages. May be overkill though. phpBB operate a similar method.

thanks to your reply ardav
well From the first I wanted to use session to denote the user level but I don't know how to limit the access using php Not mysql account

When user logs in, their level is applied. Set all new users to 0 until they activate the account (usu. email link) - which then sets it to 1. You administer other levels through your admin pages (or directly through phpmyadmin or other GUI).

user1 only update one table
user2 only view tables
user3 insert to one table only

So when adding a new user set their level like set user1's 1, user2' 2 and user3' 3. Now when a user will try to insert something into the database just make a database query with his/her username and check if he/she has level 3 privilege. If he don't don't let him run the insert query.