Re: Search Engine
| From: | James Atkinson | Date: | Fri, 15 Sep 2000 18:17:55 +0000 |
| Subject: | Re: Search Engine | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16951@lists.php.net to get a copy of this message | ||
On Fri, 15 Sep 2000, Dhaval Desai wrote:
> Hi Guys..
>
> I have a made a simple search engine...
> Now I have a form page which takes the Input and then
> searches for the string entered by the user..
> THe thing is that the search matches the whole of the
> word and brings the output. I want to get the output
> even if there is a slightest match..from the string
> entered by the users..
Try an SQL statment like this:
SELECT * FROM test WHERE tel LIKE '%$tel%';
if you have this data in your rows
Row 1) 323-3002
Row 2) 112-1122
Row 3) 909-3412
And the user enters a 3 they will get rows 1 and 3, if they enter 11 they'll
get row 2..
--
James Atkinson
-----------------------------------------------------------------
James Atkinson 100world
Technical Developer 512-1529 West 6th Avenue
phone: +1-604-637-8122 Vancouver, BC, V6J 1R1
fax: +1-604-742-1770 Canada
email: james.atkinson@100world.com http://www.100world.com
+---------------------------------------------------------------+
| This message may contain confidential and/or privileged |
| information. If you are not the addressee or authorized to |
| receive this for the addressee, you must not use, copy, |
| discolse or take any action based on this message or any |
| information herein. If you have received this message in |
| error, please advise the sender immediately by reply e-mail |
| and delete this message. Thank you for you cooperation |
+---------------------------------------------------------------+