Re: [PHP] search string

2006-07-21 Thread Andrew Kreps
You can use a regular expressions with a function called preg_match to find the values. For example, (Assuming your sql statement is $sql) preg_match(/(tbl_chassis.chasis_model LIKE \'\%[a-zA-Z0-9-]+\%\'/), $sql, $matches); That will return $matches[0] with the matched data. Similarly,

[PHP] search string

2006-07-20 Thread weetat
Hi all , I am using php4.3.2,MYSQL and RedHat I have a sql text as shown below: SELECT DISTINCT(tbl_chassis.serial_no),tbl_chassis.host_name,tbl_chassis.chasis_model,tbl_chassis.country,tbl_chassis.city,tbl_chassis.building,

[PHP] search string / query format

2004-07-09 Thread Ed Lazor
I'm going to create a search page that accepts input similar to places like Yahoo and Google. Example input would be: Keyword AND keyword2 Keyword -keyword2 +keyword3 keyword keyword2 -keyword3 Rather than reinvent things though, I'm wondering if anyone here happens to have a script or

Re: [PHP] search string / query format

2004-07-09 Thread John W. Holmes
Ed Lazor wrote: I'm going to create a search page that accepts input similar to places like Yahoo and Google. [snip] Also, I've heard that MySQL's indexing can support some of this, but I'm not sure how much. Using a FULLTEXT index and searching in BOOLEAN mode supports the type of search

Re: [PHP] search string / query format

2004-07-09 Thread John Taylor-Johnston
Keyword AND keyword2 keyword keyword2 -keyword3 It doesn't support AND or OR but it does use - + * and others. Consult thine manual!! (The MySQL one) ;) http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html The problem is getting a FULLTEXT to sort by relevancy. This was a real pain, until

RE: [PHP] search string / query format

2004-07-09 Thread Ed Lazor
-Original Message- I'm going to create a search page that accepts input similar to places like Yahoo and Google. [snip] Also, I've heard that MySQL's indexing can support some of this, but I'm not sure how much. Using a FULLTEXT index and searching in BOOLEAN mode supports

[PHP] search string

2001-04-15 Thread Joseph Bannon
What is the function to search a string? Basically, I want search a string (a url) to see if it has "www.yahoo.com" in it and if yes, tell the user their submission cannot be accepted. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: [PHP] search string

2001-04-15 Thread Brian Clark
Hi Joseph, @ 12:08:46 PM on 4/15/2001, Joseph Bannon wrote: What is the function to search a string? Basically, I want search a string (a url) to see if it has "www.yahoo.com" in it and if yes, tell the user their submission cannot be accepted. ?php $string = 'www.yahoo.com';

Re: [PHP] search string

2001-04-15 Thread Tobias Talltorp
I think you want regular expressions... Try this on for size: $str = "http://www.yahoo.com/somedir/somepage.html"; if (preg_match("/www.yahoo.com/i", $str)) { print "Your submission cannot be accepted"; } else { print "You are good"; } If you want to read up on regular expressions:

Re: [PHP] search string

2001-04-15 Thread dempsejn
Even better, try strstr...it'll be faster than a regexp for a simple search of a string for another string. -jack - Original Message - From: "Tobias Talltorp" [EMAIL PROTECTED] Date: Sunday, April 15, 2001 7:20 pm Subject: Re: [PHP] search string I think you want regular e

Re: [PHP] search string

2001-04-15 Thread Brian Clark
Hi Tobias, @ 7:20:00 PM on 4/15/2001, Tobias Talltorp wrote: I think you want regular expressions... Try this on for size: $str = "http://www.yahoo.com/somedir/somepage.html"; if (preg_match("/www.yahoo.com/i", $str)) { print "Your submission cannot be accepted"; } else { print "You