PDA

View Full Version : How does one protect all SQL db records accept the one for that particular member?


modeler4547
07-29-2004, 02:34 PM
I have a script to view and post data from an HTML form to a server based MySQL database.
I have the form password protected such that only members who have been given the password may enter the page and view the entire database.
How can I make sure that Joe Blow can only modify the data for Joe Blow and not everyone else?
How can I make it so one user may only create one record and not bombard the db with junk?
THANKS!
Rocko

azlatin2000
07-29-2004, 06:22 PM
If you have a column with the name if the user you can add

WHERE USERNAME = '{$USERNAME_Of_The_Person_Submitting_The_Form}'

To the query.

modeler4547
07-30-2004, 09:06 AM
Hi,
Would you please email me at rocky@tsgcrescent.com?
Does it sound like this is an ok scenario?

member who is on record as having paid (email address) is emailed a general password.
they use it to access the database pulled down from the server
option exists to add their personal infor to the database
they click and go to POST INFO page
this page asks for a new USERNAME and PASSWORD (not the one given above), plus other info
this is applied as a record in the database
they can edit this data using the edit form and the statement you just sent to focus on their info only because NOW they have a unique username and password store in the db.
[can't they just keep creating new usernames and passwords]?