List:General Discussion« Previous MessageNext Message »
From:Beauford.2003 Date:December 10 2002 1:44am
Subject:Re: Select * From table where name Like 'help'; Help
View as plain text  
> 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.

MySQL is not seeing $var, but it is seeing var from what I can understand of
Regexp (the manual on this is not very good), $ means to match the end of a
string, so since I have $var, I am thinking that Regexp thinks that the end
of the string I want to search for ends with var. In any event, the actual
value of  $var never gets sent to MySQL, so the search will always fail.

Maybe I am misunderstanding the meaning of this, but since I really can't
make any sense out of the manual, I am guessing at what I think they mean.

Let me give you and example:

$var=One ($var is passed the string from a form on a webpage)

There are 3 entries in the database with the word One

One Day
Day One
That's the One

There are also other words that contain the word one, like stone and anyone.

I want to be able to run a search that will just show the first 3 by typing
in the word One ('one' would result in the string not found').

Beauford


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