Try this sql statement:

// search for the keyword in NAME or DESCRIPION..
// using the wildcard '%'.

$sql="select * from TABLE_NAME where Name='%search_query%'
    OR Description='%search_query%'";

$result=mysql_query($sql) or die ("blah, blah, blah");

...more php codes...see php manual for 'mysql_query' and other
functions..
[double check the syntax]

//where 'search_query' is the form variable that is passwd to the
script...the one the user types in the keyword.

I hope that's what you were looking for..

-John


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Wed, 23 May 2001, YoBro wrote:

> Hi,
>
> Any ideas, or any code that will allow a search of specific keywords in a
> mysql database.
>
> Feilds in a Table called:
> Name
> Description
>
> What I am after is if somebody types the word 'hammer', then I want it to
> return the results in a list if the word hammer is picked up under the name
> of description feilds.
>
> Is this easier enough to do?
>
> YoBro
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to