Am Mittwoch, 25. Januar 2006 20:36 schrieb Lazarus Long:
> db eval { SELECT * FROM `auction_items` "$where" ORDER BY
> `endtime`
> DESC LIMIT 15 }
>
The problem is, db eval will treat "where" as a tcl variable for it's internal 
variable expansion, which works only in a limited sql-like, not tcl-like 
fashion. If you want to build a part of the sql statement from scratch, you 
have to write the final eval like this:

db eval "SELECT * FROM auction_items $where ORDER BY endtime"

This way $where is treated with tcl variable expansion *before* "db eval" gets 
it. However, there is a small drawback, as you have to protect all variables 
db eval should treat *internally* with backslashes.

Kind regards

        Jan

Reply via email to