|
Posted by Jerry Stuckle on 06/03/06 12:39
Bob Sanderson wrote:
> I have created a MySQL database for my company which is accessed by PHP
> pages. I would like to permit some users to edit the records but allow
> others read-only access. However, I don't want to have to enter a password
> every time I want to edit a record. Is there a way to use our network login
> to do this? If not, what is the easiest way to accomplish this? The
> database is running on our server and is not accessible via the net.
>
> Any help will be greatly appreciated.
It's not hard, Bob.
First o fall, it will be a lot easier to handle this in PHP. Just keep one
database password for all the operations.
When the user signs in with thiner own userid, determine if they can edit
records, and if so, which ones(s). Set the appropriate flag(s) in the $_SESSION
array and check them later.
Alternatively, if the choice is to edit all rows or no rows, you could give each
person their own MySQL logon/password and keep the information in the $_SESSION
array. If it is there, use it. If it's not there, ask them for it. But this
won't work if they can only edit a subset of records unless you implement a view
for each possible subset and grant appropriate permissions on the view.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|