viewing search result
| From: | Hadi | Date: | Tue, 06 Jan 2004 03:11:59 +0000 |
| Subject: | viewing search result | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32295@lists.php.net to get a copy of this message | ||
Hi Everybody,
Please help me in this,
I have a search page, when people search they keywords and the result is 50
rows from mysql , how to display them page by page which each page contain
20 results , thanks in advance :
str_replace(' ','%',$searchwords);
$query="select * from table where colom like '%$searchwords%' order by id
desc ";
$result=mysql_query($query);
$numresult=mysql_num_rows($result);
if (mysql_num_rows($hasil) > 0 ) {
echo ("<b>Found :</b> $searchwords <br><br>");
//page display
I have tried my own recipe but didn't work....
while ($data=mysql_fetch_array($result)) {
echo ("
<tr>
<td width=\"330px\"><font size
=\"3\"><br>$data[colom1]<br><br></td>
<td width=\"50px\"><p align =\"center\"><font size
=\"2\">$data[colom2]<br></td>
<td width=\"50px\"><p align =\"center\"><font size
=\"2\">$data[colom3]<br></td>
</tr>
");
Best Regards,
Hadi Tjen