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,
pre
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,
tbl_chassis.other,tbl_chassis.status,tbl_chassis.chasis_eos,tbl_c
> -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 m
>>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, un
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 stri
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 o
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
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 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:
http://www
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.
-Brian
--
PGP is spoken here: 0xE4D0C7C8
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 additiona
11 matches
Mail list logo