radar Posted August 28, 2006 Share Posted August 28, 2006 Okay I know this is supposed to be in the MySQL area but no one is over there..Okay first thing I should let you know is I am using the Smarty Template engine... Now for this site I am working on I've got 2 tables.. one is advisors and one is recommendations. They both have quite a bit of the same information... Here is my query I have right now[CODE]<?php$data = $turbo->get_all("SELECT advisors.fname, advisors.lname, advisors.advisor_id, count(recommendations.rec_id) as tot_rec, avg(recommendations.total_score) as avg_score, recommendations.total_score FROM advisors INNER JOIN recommendations ON advisors.advisor_id = recommendations.advisor_id GROUP BY advisor_id ORDER BY advisors.lname");?>[/CODE]Now this works for the most part -- but right now there is 21 entries in the advisors table and this is only picking up 14 of them.. Also something new I have to figure out is...In the Advisors table there is a list of advisors at different institutions..So say there is a John Smith at University of Marylyn and a John Smith at University of Southern California.. In the output I need to have it likeSmith, John University of MarylynSmith, John University of Southern CaliforniaSo that the recommendations are not combined for the advisor. Any help on this would be grateful.. Thanks in advance. Link to comment Share on other sites More sharing options...
Barand Posted August 28, 2006 Share Posted August 28, 2006 Why waste someone else's time answering this when you already have an answer in the other forum?DON'T double post. Read forum guidelines. Link to comment Share on other sites More sharing options...
Recommended Posts