[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] [import] update not overwrite
>
> I am trying to do a multiple checkbox add (results.html) to space delimited
> field in arbitrary db via a second receiving page and [import] tag. I was
> advised that this [import] tag I speak of will work as a faux update =>
> appending data to a field based on an existing "code".
>
> [search-region stuff]
>
> <FORM ACTION="[process-target]" METHOD="POST">
> [search-list]
> stuff here
> <INPUT TYPE=checkbox NAME=media_add VALUE="[item-code] ">
> stuff here
> [/search-list]
>
> ...
>
> ------------------
> Then in add_media.html I have:
> ------------------
>
> [flag type=write table=mediabox]
> [import table=mediabox type=LINE continue=NOTES]
> code: [cgi boxcode]
> parent: [cgi data session username]
> media: [cgi media_add]
> [/import]
>
> I have to pass ALL columns in mediabox that I wish not to be overwritten,
> because this will overwrite. Also, in the space separated area I get
>
> da00001 �da00002 �da00003
>
> I see my sku, followed by a space, then a � What is that?
>
The "�" is an encoded NULL character. Multiple (stacked)
instances of a single CGI variable will be separated with a
single NULL.
Change this line:
<INPUT TYPE=checkbox NAME=media_add VALUE="[item-code] ">
...to this:
<INPUT TYPE=checkbox NAME=media_add VALUE="[item-code]">
(remove the space)
Then change this line in your [import]:
media: [cgi media_add]
...to use the "null_to_space" filter, like this:
media: [cgi name="media_add" filter="null_to_space" keep=1]
That will give you a list of "media_add" CGI variables, separated
with a single space.
>
> Can anybody confirm if [import] will act like an update, and not a complete
> overwrite?
>
I'm sure someone will correct me if I'm wrong, but I'm reasonably
sure that the [import] tag will overwrite any column you specify
with the new value you supply.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/