1SELECT dashboard_data.headline, dashboard_data.message, dashboard_messages.image_id, images.filename
2FROM dashboard_data
3 INNER JOIN dashboard_messages
4 ON dashboard_message_id = dashboard_messages.id
5 INNER JOIN images
6 ON dashboard_messages.image_id = images.image_id
1SELECT areas.name AS aname, COUNT(consultants.active) AS cct
2 FROM areas
3 LEFT JOIN consAreas
4 ON consAreas.area = areas.id
5 LEFT JOIN consultants
6 ON consultants.id = consAreas.cons
7 WHERE areas.areaID = $area
8 AND consultants.active = 1
9GROUP BY areas.name
10ORDER BY areas.name
11
1SELECT
2 t1.name name,
3 t1.id id,
4 t1.add_date add_date,
5 t2.soc_township township_name1,
6 t2.soc_name soc_name,
7 t3.name township_name
8FROM block t1
9INNER JOIN society t2
10 ON (t1.soc_id = t2.id)
11INNER JOIN township t3
12 ON (t2.soc_township = t3.id)