Paging results from a query - Mailing list pgsql-novice

From Anatole Laffreux
Subject Paging results from a query
Date
Msg-id 1330854819.57394.YahooMailNeo@web29213.mail.ird.yahoo.com
Whole thread Raw
Responses Re: Paging results from a query
List pgsql-novice
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






pgsql-novice by date:

Previous
From: Tareq Aljabban
Date:
Subject: initDB - storage manager issues
Next
From: Frank Bax
Date:
Subject: Re: Paging results from a query