[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] SQL update problems
>
> 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
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/