Hello all,
I am using the following code to search results in a MySQL database table:
<table>
<?php
mysql_pconnect('localhost','root','');
mysql_select_db('gmarch_support');
$result = mysql_query("SELECT * FROM keyit WHERE comment LIKE '%{$_REQUEST['search']}%' order by company"
if(mysql_num_rows($result) == 0) {
echo 'Nothing found';
} else {
while($row = mysql_fetch_row($result)) {
$akey = $row[0];
$company = $row[1];
$type = $row[2];
$web = $row[3];
$comment = $row[4];
echo "<tr><td>$company</td></tr>";
echo "<tr><td>$comment</td></tr>";
}
}
?>
</table>
It is returning the results fine but I was wondering how I return a set number of results eg. 10 per page.
Any help would be much appreciated, thankyou.
Rachel
I am using the following code to search results in a MySQL database table:
<table>
<?php
mysql_pconnect('localhost','root','');
mysql_select_db('gmarch_support');
$result = mysql_query("SELECT * FROM keyit WHERE comment LIKE '%{$_REQUEST['search']}%' order by company"
if(mysql_num_rows($result) == 0) {
echo 'Nothing found';
} else {
while($row = mysql_fetch_row($result)) {
$akey = $row[0];
$company = $row[1];
$type = $row[2];
$web = $row[3];
$comment = $row[4];
echo "<tr><td>$company</td></tr>";
echo "<tr><td>$comment</td></tr>";
}
}
?>
</table>
It is returning the results fine but I was wondering how I return a set number of results eg. 10 per page.
Any help would be much appreciated, thankyou.
Rachel