Hey,
Simple solution:

<?

$search = "hammer";

$connection = // Connection to the database details.

$query = @mysql_query("SELECT * FROM table WHERE Name LIKE '%$search%' OR
Description LIKE '%$search%' ORDER BY Name ASC", $connection)
    or die (mysql_error());

while($row = mysql_fetch_array($query)) {
    $name = $row['Name'];
    $description = $row['Description'];

    echo "<b>" . stripslashes(htmlentities($name)) . "</b>\n<BR>\n" .
stripslashes(htmlentities($description)) . "<BR><BR>\n";

}

?>

James.

""YoBro"" <[EMAIL PROTECTED]> wrote in message
9eg0jl$5ac$[EMAIL PROTECTED]">news:9eg0jl$5ac$[EMAIL PROTECTED]...
> 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