"Paul Houselander" <housey@xxxxxxxxxxxxxx> writes: > $uweeklysqlu = "UPDATE stats_? SET > statdate=?,inctr=inctr+?,insize=insize+?,inspam=inspam+?,invir=invir+?,outct > r=outctr+?,outsize=outsize+?,outspam=outspam+?,outvir=outvir+? WHERE > account=? AND stattype=? AND statmode=? AND extract(week from > statdate)=extract(week from date ?) and extract(year from > statdate)=extract(year from date ?)"; "date ?" is incorrect. You got away with it before because you were using an older driver that substituted a literal constant into the query before sending it (ie, the query wasn't really prepared at all). The right way is "?::date", or more verbosely "CAST(? AS date)". See the discussions of casting and assigning types to constants in sections 4.1.2.5 and 4.2.8 of the manual. I doubt that "stats_?" as a table name is going to work either. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend