Gotta (I think) weird situation. I am coding a web app in PHP (not a newbie) and am querying two tables in a database, each with different info and result set. With my other queries within the app, I present the result rows (5) at a time. There is a "Next" and "Previous" to traverse the results up or down, (5) at a time. No problem.
This one is different. Within a table of I want to show the results of first query first (before the second), (5) at a time. Then show the second query (5) at a time. All within the same table stucture using the "Next" and "Previous".
I have been using:
<determine the number of rows in the query and make that your maximum number of rows to show>
for($i=$start;$i<end;$i++){
$row = pg_fetch_array($result,$i,$PG_ASSOC);
$line = $row["ContentID"];
...
<print lines containing result set info in some fashion>
...
}
<make sure $end does not exceed the total number of rows>
Where $start is "0" or "$end + 5" (depending on if $end incremented or not) and $end is "$start + 5".
My problem is, how do I start showing lines from the second query in the same table only after the first query lines have been shown? ie (sorry for the bad example):
(assume results 1 - 15 have been shown already)
Next - Previous
query1 result 16
query 1 result 17 <- last of first query results
query 2 result 1 <- first of second query results
query 2 result 2
query 2 result 3
The next set of course would start with query 2 result 4 and end with result 8.
How would I be able to do this? Any code examples?
TIA
-Wes Yates