Hi,<br><br> I just want to print the content of the query. I hope you can check out<br> if my code is correct:<br><br> create a database with a table named KeyWords.<br><br> create table KeyWords (<br> KwID int(7),<br> Kwords char(15),<br> PRIMARY KEY (KwID));<br><br> and here's the code:<br><br> <?<br> $db = mysql_pconnect("host", "username", "password"
;<br> mysql_select_db("dbasename"
;<br><br> print "<HTML>";<br> print "<HEAD><TITLE>Keywords</TITLE></HEAD>";<br> print "<BODY>";<br> print '<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0 WIDTH=468><TR<br> VALIGN=TOP><TD>';<br> print "<FORM ACTION=\"$PHP_SELF\" METHOD=\"POST\">";<br> print "<BR><INPUT TYPE=\"TEXT\" NAME=\"KeyWords\" SIZE=30>\n";<br> print "<INPUT TYPE=\"SUBMIT\" NAME=\"Search\" VALUE=\"Search\">\n";<br> print '</TD></TR></TABLE><BR>';<br><br> $my_array = explode(" ", $KeyWords);<br><br> for($i = 0; $i < count($my_array) ; $i++)<br> {<br> print "$my_array[$i]<BR>";<br> }<br><br> if($KeyWords != " "
{<br> $count = count($my_array);<br> $sql .= "SELECT * from KeyWords where ";<br> for ($i=0;$i<count($count);$i++) {<br> if ($i == $count) {<br> $sql .= "(Kwords LIKE '%$my_array[$i]%')";<br> }<br> else {<br> $sql .= "(Kwords LIKE '%$my_array[$i]%') OR ";<br> }<br> }<br> $sql .= "
";<br><br> $result = mysql_query($sql,$db);<br><br> print "$result";<br> }<br> print "</BODY></HTML>";<br> ?><br><br> If I entered a keyword which is existing in the table, it should display<br> the keyword if its not, it should display nothing.<br><br> I hope you'll be able to help me, thanks in advance...<br><br> PHUTIE<br><br>