...

View Full Version : SELECT but not UPDATE



kenwvs
08-10-2006, 07:42 AM
If I have used SELECT to review a row of data from a table and then only want to allow it to UPDATE certain fields, even if the other fields were changed, would I use the UPDATE command, and choose which fields can be updated? Will this stop the other fields from being updated? I am trying to prevent people from changing certain values in the table.

justincredible
08-10-2006, 03:06 PM
Yeah, the UPDATE will only change the fields that you tell it to in the SET part of the query.

guelphdad
08-10-2006, 03:19 PM
If the users have UPDATE privileges on the table then they can set whatever columns they want.

What you can do though is set individual column_priv (column privileges) for the table and then they can only update the columns you allow them to do. I've never done that at the column level.

Here (http://www.devshed.com/c/a/MySQL/The-MySQL-Grant-Tables/) is an article that might help you understand how to do that at the column level.

kenwvs
08-10-2006, 05:08 PM
The people will be viewing it through an online form that they can access, but I don't want someone to update fileds that someone else has filled in, but I need them to be able to review them. They will have an opportunity to complete other fields, which obviously would need to be updated.

arnyinc
08-10-2006, 07:01 PM
Just echo the value from the database then. Don't give them a text box to update it.

kenwvs
08-10-2006, 07:04 PM
I have used UPDATE table set fields to update WHERE Row to only allow certain fields to be updated.... I hope this will work



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum