List:General Discussion« Previous MessageNext Message »
From:Andy Bakun Date:December 9 2002 10:37pm
Subject:Re: Select * From table where name Like 'help'; Help
View as plain text  
On Mon, 2002-12-09 at 16:10, Beauford.2003 wrote:
> Andy,
> 
> I mentioned in my previous email that I am using PHP, and I have also tried
> putting quotes around $var (many different ways) with no better results.
> REGEXP just gives a syntax error when I do this.

I'm sorry, I did miss the where you said you were using PHP. Just found
it.  But I was responding to:

   The real value of $var is not inserted before it is sent to the
   server.  REGEXP thinks that 'var' is part of the search pattern
   because $ is a reserved operator for REGEXP.

This is most definitely a quoting issue with your PHP string.  If it is
quoted correctly, the MySQL server will never see the string $var
appearing after the keyword REGEXP, so if $ has meaning to a regular
expression wouldn't matter (unless the value of $var contained a $). 
I've used REGEXP with (really complex) dynamicly built regular
expressions stored in PHP variables a number of times and have never had
a problem as you've described above.

> Through the suggestion of another list user I have found a way that suits my
> needs using the "where name like binary '$var'". It's jury rigged, but works
> the way I need it to work for the most part.

Don't give up now!  A perfect solution can be found! :)

Andy

Thread
Select * From table where name Like 'help'; HelpBeauford.20039 Dec
  • Re: Select * From table where name Like 'help'; HelpJocelyn Fournier9 Dec
  • Re: Select * From table where name Like 'help'; HelpRobert Citek9 Dec
    • Re: Select * From table where name Like 'help'; HelpBeauford.20039 Dec
      • Re: Select * From table where name Like 'help'; HelpBenjamin Pflugmann9 Dec
    • Re: Select * From table where name Like 'help'; HelpBeauford.20039 Dec
      • ADO Bulk InsertsMichael She10 Dec
        • RE: ADO Bulk InsertsFernando Grijalba10 Dec
          • RE: ADO Bulk InsertsMichael She10 Dec
            • RE: ADO Bulk InsertsFernando Grijalba10 Dec
              • RE: ADO Bulk InsertsMichael She10 Dec
                • RE: ADO Bulk InsertsFernando Grijalba10 Dec
                  • RE: ADO Bulk InsertsMichael She10 Dec
                    • RE: ADO Bulk InsertsPaul DuBois11 Dec
                      • RE: ADO Bulk InsertsMichael She11 Dec
                        • RE: ADO Bulk Insertsed11 Dec
                        • RE: ADO Bulk InsertsPaul DuBois11 Dec
      • Re: OT Select * From table where name Like 'help'; HelpMichael T. Babcock10 Dec
      • Re: Select * From table where name Like 'help'; HelpAndy Bakun10 Dec
      • Re: Select * From table where name Like 'help'; HelpBenjamin Pflugmann10 Dec
    • Re: Select * From table where name Like 'help'; HelpBeauford.200310 Dec
      • Re: Select * From table where name Like 'help'; HelpAndy Bakun10 Dec
      • Re: Select * From table where name Like 'help'; HelpRobert Citek10 Dec
    • Re: Select * From table where name Like 'help'; HelpBeauford.200310 Dec
  • Re: Select * From table where name Like 'help'; HelpBeauford.20039 Dec
RE: ADO Bulk InsertsAlan R Anderson11 Dec
  • RE: ADO Bulk InsertsMichael She11 Dec