MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Update Form: check old values before update - multi record update



******    message to minivend-users from pro200@iae.nl     ******

Hi All,

I am using forms to update records in mySQL tables. This works great.
However, I have a need for testing the 'old' values against the values
in the database right before updating the record (multi users are
updating database).

Is it possible to do this with the 'regular' MiniVend stuff? I have
checked the docs and mailing list but I didn't come across something
similar. Has anyone done this before or does anyone know how to go
about? The "update" form function doesn't check the old values, it
just replaces the values in the database with the form values.

I thought about the following:
Put hidden fields on the update form that hold the 'old' values like:
<INPUT TYPE="hidden" name="old.field1" value="field1"> etc.
<INPUT TYPE="text" name="field1" value="field1"

Then have the update function build a WHERE-clause containing all
'old' values.
UPDATE .... WHERE field1='old.value1' AND field2='old.value2'  etc.

In this case a record only will get updated when it was not changed by
someone else during my own update session. If it was changed then say
something like: "Record has been changed by someone else. Please go
back and (reload) try again".

Of course this would only be possible when the form update function
supports the check. Any ideas how to implement this feature?

Another thing I think would be a neat feature is: multi record update
on a form. Like a spreadsheet. Is this possible? And if, how? Any
ideas?

Any help is warmly welcomed.

Many thanks for your kind assistance.

Best regards,

Tom


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: