On Fri, May 10, 2002 at 05:49:12PM +0200, Mark wrote:
: > This is too weird; I can quote until I see blew in the face, but I cannot
: > seem to make MySQL understand that the name 'group-name' is valid to
: > select. It keeps blabbing "You have an error in your SQL syntax". I mean,
: > what is the purpose of its own quote function if it can not even quote
: > properly? Every other name works fine, except when a WHERE clause looks
: > for a column whose value has a dash in it. [/snip]
: >
: > Can we see the query?
: >
: > Jay
: 
: Sure.
: 
: $sth = $dbh -> prepare ("SELECT expiration from newsgroups WHERE
: newsgroup='$group'");
: $sth -> execute;

Try:

  $sth = $dbh->prepare( 'SELECT expiration FROM newsgroups WHERE newsgroup=?' );
  $sth->execute( $group );
  ...

* Philip Molter
* Texas.net Internet
* http://www.texas.net/
* [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to