----- Original Message -----
From: "Tedit kap"

Hi,

I have a table like

articleid-articledate-articletitle-articlebody

I am looking for a simple php script that will search my database which 
contains articles against keywords entered by the user...So, it should bring up 
that article that contains that keyword or words entered by the user.

For example:
select * from the_table where articletitle or articlebody contains keyword

of course this is wrong syntax I guess but I just wrote this to explain what I 
want: search a certain keyword in article text body and bring the results....

What is the correct syntax? I could not see a "contains" or something like that 
when I searched....

__________________________________________________________

You can use this SQL statement:

$keyword = $_GET["keyword];
$strSQL = "SELECT FROM the_table WHERE articleid LIKE '%$keyword%' OR 
articledate '%$keyword%' OR articletitle '%$keyword%' OR articlebody 
'%$keyword%'";
mysql_query($strSQL);

I hope it can help you.

Regards,
---
Angga Sanjaya Lingga

Reply via email to