List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:September 12 2002 8:42pm
Subject:Re: Problems with a Quote in Select
View as plain text  
in perl you would do
my $qselcat=$dbh->quote($selcat);
$whichpart = "AND key1=$qselcat";


René Fournier wrote:

> Hello everyone,
>
> I'm trying to Select on a field that contains a doublequote, and can't 
> figure out how to pass it throught the Select statement (couldn't find 
> anything in the docs either...)
>
> -=-=-=-=-
>
> This doesn't work...
>
> $whichpart = "AND key1='$selcat'";
> $result = mysql_query("SELECT * FROM parts WHERE status='online' 
> $whichpart",$db);
>
> ...when $selcat contains a double quote. For example, if I echo 
> $selcat, I get:
>
> AND key1='36\" Core Shafts'
>
> ======
> I can see that mysql is choking on that double quote--do I need to 
> convert it to something else? Thanks.
>
> ...Rene
>
> ---
> René Fournier,
> rene@stripped
>
> Toll-free +1.888.886.2754
> Tel +1.403.291.3601
> Fax +1.403.250.5228
> www.smartslitters.com
>
> SmartSlitters International
> #33, 1339 - 40th Ave NE
> Calgary AB  T2E 8N6
> Canada
>
>
> ---------------------------------------------------------------------
> 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 <mysql-thread119423@stripped>
> To unsubscribe, e-mail 
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


Thread
Problems with a Quote in SelectRenĂ© Fournier13 Sep
  • Re: Problems with a Quote in SelectGerald Clark13 Sep
  • Re: Problems with a Quote in Selectwalt13 Sep
Re: Problems with a Quote in SelectPaul DuBois13 Sep