[Phpmyadmin-devel] Re(4) : SQL parser

Lo�c loic-div at ifrance.com
Tue Jul 23 00:59:02 CEST 2002


Hi again!

First I must tell you than I no long have access
to any server from my work. So, Robin, I've modified
your but didn't test it. It may then be buggy but I
can't check it.

[About the "PMA_sqlParser_isEscaped()" recursive function]
Marc sent you the valid reply ;)

[About the "===" operator]
>How does one then properly evaluate some expressions?
>$f = FALSE;
>$g = 0

You have to play with the "is_integer()" function.

>My code relies on this difference, as some of the PHP
>functions (strpos namely) return FALSE for not found,
>and integers [0-strlen).

Check users' comments about the "strpos" function in the
online php documentation: we can't rely on the type of
the returned value since different PHP versions return
different type.
The only way to do it is to add a known character before
the string you're searching into, this way you know a zero,
FALSE, empty... value returned means the haystack has not
be found.

>function PMA_sqlParser_strInStr($needle,$haystack)
>{
>-    return (strpos($haystack,$needle) !== FALSE);
>-}
>+    return (strpos(' ' . $haystack, $needle) > 0);
>+} // end of the "PMA_sqlParser_strInStr()" function

>Actually breaks the function, stopping it from recognizing
>some things.

The problem is that I can't test it, then it's a bit hard
for me to find where is the error.

>Tell me what text editor you are using with what settings,
>so that I can work out settings for my vim to do this
>properly.

I'm using either UtlraEdit, either vi, either a windows
port of vi...
Have you see the vim settings suggested at the "PEAR coding
standard" web page?

Loïc

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif






More information about the Developers mailing list