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 &lt;[email protected]&gt; wrote:
[snip]
&gt; 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 "
&gt;
&gt;     SELECT DISTINCT price
&gt;     FROM   product
&gt;     WHERE  name = ? order by
&gt;
&gt; you could see that the second %s is not passed in, the first %s is ok, could
&gt; someone give me a clue?

Looks to me like you need a second argument for the "order by" %s:

$class-&gt;sql_distinctByProduct($col, $col)-&gt;select_col($productName);

Rod

_______________________________________________
ClassDBI mailing list
ClassDBI-Ra3b/[email protected]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.