Re: Re: [CDBI] how to use variable as col umn name in set _sql
"pangaoyong" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
Thanks, it is very clear and works now. -----原始邮件----- 发件人:"Rod McChesney" <[email protected]> 发送时间:2006-06-09 11:06:43 收件人:"pangaoyong" <[email protected]> 抄送:"classdbi" <classdbi-Ra3b/[email protected]> 主题:Re: [CDBI] how to use variable as column name in set _sql On 6/8/06, pangaoyong <[email protected]> wrote: [snip] > DBD::mysql::st execute failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 [for Statement " > > SELECT DISTINCT price > FROM product > WHERE name = ? order by > > you could see that the second %s is not passed in, the first %s is ok, could > someone give me a clue? Looks to me like you need a second argument for the "order by" %s: $class->sql_distinctByProduct($col, $col)->select_col($productName); Rod _______________________________________________ ClassDBI mailing list ClassDBI-Ra3b/[email protected] http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi