[ic] strange database update behavior
peter at pajamian.dhs.org
Sun Sep 13 20:03:48 UTC 2009
On 09/13/2009 07:22 AM, DB wrote:
> I'm using a form like this which runs from within a [query]... it always
> works fine unless I try to update the table with an empty string.
> ============= BEGIN CODE ===============
> [set mv_data_enable]1[/set]
> [tag flag write]transactions[/tag]
> <FORM METHOD=GET ACTION="[process]">
> <input type=hidden name=mv_session_id value="[data session id]">
> <INPUT TYPE=HIDDEN NAME="mv_data_table" VALUE="transactions">
> <INPUT TYPE=HIDDEN NAME="mv_data_key" VALUE="order_number">
> <INPUT TYPE=HIDDEN NAME="mv_data_function" VALUE="update">
> <INPUT TYPE=HIDDEN NAME="mv_nextpage" VALUE="order_updated">
> <INPUT TYPE=HIDDEN NAME="mv_data_fields" VALUE="notes">
You seem to be missing:
<input type="hidden" name="mv_todo" value="set">
The default todo action is actually "back" which is pretty much a "do
nothing" action, so it does need to be explicitly set.
> <TEXTAREA NAME="notes">
> [data table=transactions col=notes key=[loop-code]]
You mentioned the [query] tag above. [query] has a default prefix of
"sql" so unless you have explicitly set prefix=loop in your [query] tag
then the above should be [sql-code], not [loop-code]. This is probably
causing the form to not show the current notes.
Additional Note: If you return the notes column as part of your [query]
then you can use [sql-param notes] above instead of the [data] tag which
will save you one or more db hits. This is not the cause of your
> <INPUT TYPE=submit VALUE="Update & Unlock">
Another note: This is not the cause of your problem but the above value
should probably be: "Update & Unlock".
> ============= END CODE =================
> I'll check the mysql logs as Racke wisely advised as well.
Yes, good idea.
More information about the interchange-users