List:General Discussion« Previous MessageNext Message »
From:Pat Sherrill Date:May 22 1999 12:11pm
Subject:Re: Selecting cells -- problem
View as plain text  
SQL syntax is not correct, it should read:

select * from id where email like '%xoom%'

Equal implies an exact match. You cannot have an exact match with wildcards.
Use 'like' instead of '='.

I hope this helps.


----- Original Message -----
From: Svetoslav B. Alexandroff <alexandroff@stripped>
To: <mysql@stripped>
Sent: Saturday, May 22, 1999 3:49 AM
Subject: Selecting cells -- problem

I have a problem.

I am writing a PHP script that should search a MySQL base for something
containing a given string. I issue the following query:

select * from id where email = '%xoom%'

I want to match all cells named 'email' which contain the string 'xoom'
somewhere. Although I have such cells, there is no result - nothing found.

I read the documentation coming with MySQL and I found that % is the
wildcard. However the documentation is somehow unclear to me and I couldn't
find solution to my problem.

Any help would be appreciated.


Selecting cells -- problemSvetoslav B. Alexandroff22 May
  • Re: Selecting cells -- problemPat Sherrill22 May