On Wed, 24 Oct 2001, John Abel wrote:

> Hi,
>
> I am having bother trying to perform a select, that has an apostrophe in
> the value I’m looking for.  Below is the Perl code I’m using.
>
>       $SQLStatement = "SELECT ID FROM Albums WHERE Name =
> '".$DBHandle->quote($Name)."';";
>       $STLookUpHandle=$DBHandle->prepare($SQLStatement);
>       $RVSelect=$STLookUpHandle->execute();
>
> $SQLStatement contains the following:
>
>       SELECT ID FROM Albums WHERE Name = ''Kill \'Em All'';
>
> And I receive this error:
>
>       DBD::mysql::st execute failed: You have an error in your SQL syntax near
> 'Kill \'Em All''' at line 1
>
> Any help would be appreciatred.

$DBHandle->quote adds the quotes for you, remove them in your
SQL-statement.

--
patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-706355528


---------------------------------------------------------------------
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