Hello
I have this script and would like to get the results paged like in a search engine. How can I do this ?
<html><body><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Name</td>
<td>Telephone</td>
<td>Activity</td>
<td>Adress</td>
</tr>
<?php
$db = pg_connect('host=myserver dbname=mydatabase user=postgres password=mypassword');
$query = "SELECT name,telephone,activity,adress FROM mytable where activity like '%restaurant%' and city like 'Boston%'";
$result = pg_query($query);
if (!$result) {
echo "Problem with query " . $query . "<br/>";
echo pg_last_error();
exit();
}
while($myrow = pg_fetch_assoc($result)) {
printf ("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>", $myrow['name'], htmlspecialchars($myrow['telephone']), htmlspecialchars($myrow['activity']), htmlspecialchars($myrow['adress']));
}
?>
</table></body></html>
Thanks in advance for help