|
Posted by joanna on 10/28/07 13:14
On Oct 28, 7:53 am, bmic...@gmail.com wrote:
> If I understand your problem correctly; you're having problem
> distributing the SQL query on several pages.
>
> By using ORDER BY, you can keep track of what was displayed already.
>
> SELECT ID,Title
> FROM table
> WHERE Title LIKE '" . $_GET['title'] . "%'
> ORDER BY title
> LIMIT 0, 100
>
> Depending on how many results you want to display per page (let's say
> 100). You can modify the LIMIT. That is for page 1 'LIMIT 0, 100', for
> page 2 'LIMIT 100, 200' and so on
>
> >> echo "<td><a href=\"page2.php?title=" .$title. "\"> $title</a></td>
>
> This here looks like a bad design idea. You should instead have a
> variable (which you can pass through $_GET), which tells you which
> page you're on.
>
> $params = "?title=" . $title . "&page=" . $page;
>
> Hope this helps
It kind of helps, the order by is something that was needed. However,
maybe I wasn't clear, but I'm having a tough time trying to paginate
the rest of the results as in a "next" and "previous" link at the
bottom. The results are in the thousands and doing a manual page for
each 100 results would be too much.
[Back to original message]
|