Idle thought (php/mysql)

Soldato
Joined
24 Nov 2002
Posts
16,378
Location
38.744281°N 104.846806°W
I was using phpmyadmin earlier and had an idle thought.

How does it know what I'm updating?

Say I have a simple table:

id | value
1 | a
2 | b
3 | c

If I have an edit form that displays the first record only (to edit):

id: 1
val: a

And I change (on the form) a to f and submit, presmuably update val where id = 1 and val = a to val = f, would be called. However, how can you let it know the original value of the field... hidden fields?

If id(form).value != id(hidden).value, update id(hidden) field with id(form).value?

Did that make any sense? :(
 
Probably - some method of storing a value which will later change (e.g. hidden form fields, and unrealistically cookies/sessions etc.)
 
psyr33n said:
Probably - some method of storing a value which will later change (e.g. hidden form fields, and unrealistically cookies/sessions etc.)
Thought so :)

Lots of if statements then if you have a mass of fields and hidden field for each editable field.

I'm dense some times.
 
Back
Top Bottom