[ic] SQL update problems
Kevin Walsh
interchange-users@interchange.redhat.com
Tue Feb 5 19:06:00 2002
>
> I'm trying to update certain records based on where criteria. Here is what I
> have
>
> [query list=1
> table=catalogs
> st=db
> sql="UPDATE catalogs
> SET shipmode = 0, catdropdate = `$tag->time{%Y%M%d}`
> WHERE country = 'US' AND show_qty = '1' AND shipmode = '1' AND completed
> != '1'
>
> "]
>
> In my error log...
>
> /admin/update_contacts.html Bad SQL statement: Parse error near
> `$tag->time{%Y%M%d}`
> > WHERE country = 'US' AND show_qty = '1' AND mv_shipmode = '1' AND
> completed != '1'
>
> It appears that the problem is $tag... but how can I put an update time
> stamp on the row?
>
I don't suppose you tried the actual tag [time], in place of your
"$tag->time" (should be $Tag), did you? You will also need proper
quotes round the time otherwise the SQL will be in error.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/