Re: [sqlite] SQLite / php - Using REGEXP

2007-02-13 Thread Cecilia VIGNY

[EMAIL PROTECTED] a écrit :

Cecilia VIGNY <[EMAIL PROTECTED]> wrote:
  

Hi,

I'm developing a Php program which uses a SQLite database. I want to 
execute an SQL request :


select * from dicsupp WHERE supp regexp 'test';

It doesn't work... What's wrong ?




From the documentation, specifically at
http://www.sqlite.org/lang_expr.html:

   "The REGEXP operator is a special syntax for the regexp() user
function. No regexp() user function is defined by default and
so use of the REGEXP operator will normally result in an error
message. If a user-defined function named "regexp" is added at
run-time, that function will be called in order to implement
the REGEXP operator."

So you need to add a regexp() user function in order for the
REGEXP operator to work.  I suspect you can do that from PHP
but I do not personally know exactly how it is done.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-

  

This is not practical... :(
I'm working with ADOdb, to abstract my MySQL and SQLite databases...
I'm going to search for a compatible solution, even if it will be less 
powerful


Thank you for all responses



Ce message est protégé par les règles relatives au secret des correspondances. 
Il est donc établi à destination exclusive de son destinataire. Celui-ci peut 
donc contenir des informations confidentielles. La divulgation de ces 
informations est à ce titre rigoureusement interdite. Si vous avez reçu ce 
message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail 
figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, 
this message is intended solely for the attention of the addressee. This 
message may contain privileged or confidential information, as such the 
disclosure of these informations is strictly forbidden. If, by mistake, you 
have received this message, please return this message to the addressser whose 
e-mail address is written above and destroy this message and all files attached.



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite / php - Using REGEXP

2007-02-13 Thread drh
Cecilia VIGNY <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm developing a Php program which uses a SQLite database. I want to 
> execute an SQL request :
> 
> select * from dicsupp WHERE supp regexp 'test';
> 
> It doesn't work... What's wrong ?
> 

From the documentation, specifically at
http://www.sqlite.org/lang_expr.html:

   "The REGEXP operator is a special syntax for the regexp() user
function. No regexp() user function is defined by default and
so use of the REGEXP operator will normally result in an error
message. If a user-defined function named "regexp" is added at
run-time, that function will be called in order to implement
the REGEXP operator."

So you need to add a regexp() user function in order for the
REGEXP operator to work.  I suspect you can do that from PHP
but I do not personally know exactly how it is done.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite / php - Using REGEXP

2007-02-13 Thread Michael Schlenker

Cecilia VIGNY schrieb:

Hi,

I'm developing a Php program which uses a SQLite database. I want to 
execute an SQL request :


select * from dicsupp WHERE supp regexp 'test';

It doesn't work... What's wrong ?

Thank you ! ;)

There could be all sorts of things wrong. Your SQL code looks correct so 
far (but using regexp with a constant pattern like 'test' is a bit 
inefficient).


Do you get any error message? How do you execute your statement?

Michael

-
To unsubscribe, send email to [EMAIL PROTECTED]
-