News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

paginating data w/ inner table joins

Started by Les Mackenzie, November 18, 2003, 09:57:11 AM

Previous topic - Next topic

Les Mackenzie

I'm having some trouble paginating data using an inner table join. I know that the query for a standard pagination would look something like this...


PHP:
--------------------------------------------------------------------------------

$query1="SELECT COUNT(*) AS Total FROM table WHERE terr_ID='$SESSION_TERR_ID' ORDER BY $ordertype $ranking";

--------------------------------------------------------------------------------


but is there a way to paginate data after using a table join? I need the information off of both tables for the query and my table join looks something like this...

PHP:
--------------------------------------------------------------------------------

$query1="SELECT T2.ID, T2.pharm_ID, T1.activity AS Total FROM pharmacies T1 INNER JOIN pharmacist T2 ON T1.Ph_ID=T2.Ph_ID WHERE T1.terr_ID='$SESSION_TERR_ID'";

--------------------------------------------------------------------------------


Does anyone know how to make such a paginating query work?
BLOGS SUCK! - HERE READ MINE

Please Note:  Arguing on the internet is like running in the Special Olympics...  Even if you win you're still retarded.

Advertisement: