List:General Discussion« Previous MessageNext Message »
From:Benjamin Pflugmann Date:December 9 2002 3:23pm
Subject:Re: Select * From table where name Like 'help'; Help
View as plain text  
Hello.

On Mon 2002-12-09 at 09:22:09 -0500, beauford.2003@stripped wrote:
> I am using PHP on my website, but this is certainly a MySQL question.
> 
> > That shouldn't matter, because the real value $var is inserted before
> > the query is send to the MySQL server, where REGEXP of the query is
> > evaluated. If there is a problem, you need to be much more
> > specific. Quote the error message, show the relevant part of your code
> > and so on.
> 
> The real value of $var is not inserted before it is sent to the server.

Why not? What is $var? You called it a variable, and there are no
variables of the form $var in MySQL, but only @var. So I presumed that
you mean a PHP variable by $var. If that is not the case, please be
more specific, as I already asked you. Else, this will become a
guessing game.

If it is the case, PHP will replace $var by its value and send the
modified query to MySQL, without the $ sign. If you have reason to
believe otherwise, please cite an example. But I am repeating myself.

[...]
> So the questions still remains, how do I get REGEXP to treat $var as a
> variable and not part of its own syntax.

In order to make $ non-special, you have to escape it by a
backslash. In order to get the backslash to the server, you have also
to escape the backslash. How often depends on your exact statement
(which kind of quotes you use, etc.)

> I have been looking at http://www.mysql.com/doc/en/Regexp.html, but
> it does not cover this.

You are right. This page fails to mention how to handle special
characters at all.

HTH,

	Benjamin.


-- 
benjamin-mysql@stripped
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