|
|
vbCrLf
Registerd on: 01/01/1970, 04:00:00
Location:: C:\WINDOWS\System32\
Posts: 15
|
|
|
|
|
|
|
|
I'm developing an open source system.
No matter why, I need a way to send a query so it will can't change anything. Only read (SELECT).
I don't want to use the MySQL administration program, create another user with permission, etc. I need it to be easy - only pure PHP.
I thought about analyzing the query by myself, but its hard to do it not hackable... Maybe I need to create another connection with permissions only to read or something like that.
Does anyone have any idea?
Edit by : vbCrLf At 22/06/2006, 12:41:04
|
del C:\WINDOWS\System32\*.* |
|
|
|
|
codingr
Global Admin
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 91
|
|
|
|
|
|
|
|
You dont have to use any administration program.
Mysql supports in user's limtation, which means you can give a user access rights.
Here is a "short" query as an example of how to change that :
REVOKE ALL PRIVILEGES ON * . * FROM ''user@'localhost';
REVOKE GRANT OPTION ON * . * FROM ''user@ 'localhost';
GRANT SELECT ON * . *
TO ''user@ 'localhost'
|
|
|
|
|
|
vbCrLf
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 15
|
|
|
|
|
|
|
|
How am I doing it in PHP? Sending it as a query?
And if I'm doing it, will I can to send some of the quries with write permission and some without?
|
|
|
|
|
|
codingr
Global Admin
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 91
|
|
|
|
|
|
|
|
Yeah, i meant as sending it as query.
If you want to divide your queries and use two diffrent with two diffrent access rights.
For the limited queries, use the limited user and as for the full queries just use the root user who has full access.
|
|
|
|
|
|
vbCrLf
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 15
|
|
|
|
|
|
|
|
But I need to create another user...
Its will be open source, and if someone will want to use it at free server? And like I said it before, I want it to be simple.
|
|
|
|
|
|
codingr
Global Admin
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 91
|
|
|
|
|
|
|
|
Then i guess that your best way here, is to create your own limitation system.
|
|
|
|
|
|
vbCrLf
Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 15
|
|
|
|
|
|
|
|
If you will find a way, please tell me...
Ok... Thanks...
|
|
|
|
|