nezbo Posted October 16, 2007 Share Posted October 16, 2007 Hi I have this code :: // ----------------------------- select infor from mySQL ------------------------------// $getInfo = mysql_query("SELECT person.*, site.*, _fullrota.*, _daysoftheweek.*, _duty.*, _payrate.*, _weeknumber.*, holidayrequest.* FROM person, site, _fullrota, _daysoftheweek, _duty, _payrate, _weeknumber, holidayrequest WHERE ( site.SiteID = _fullrota.fullLocation AND _weeknumber.weekID = _fullrota.fullWeekNumber AND _payrate.payRateID = _fullrota.fullPayRate AND _duty.dutyID = _fullrota.fullDuty AND person.CallID = _fullrota.fullStaffName AND _daysoftheweek.dayID = _fullrota.fullRotaDay $selectedUser AND _fullrota.Other = 0 AND _fullrota.giveAway = 0 AND _fullrota.sickRequest = 0 AND trainingDays = 0 AND _fullrota.fullRotaID = holidayrequest.shiftID ) || ( site.SiteID = _fullrota.fullLocation AND _weeknumber.weekID = _fullrota.fullWeekNumber AND _payrate.payRateID = _fullrota.fullPayRate AND _duty.dutyID = _fullrota.fullDuty AND person.CallID = _fullrota.fullStaffName AND _daysoftheweek.dayID = _fullrota.fullRotaDay $selectedUser AND _fullrota.Other = 0 AND _fullrota.giveAway = 0 AND _fullrota.sickRequest = 0 AND trainingDays = 0 AND _fullrota.holidayRequest = 1 ) ORDER BY _fullrota.fourWeekDate ASC, _weeknumber.weekID ASC, _daysoftheweek.Priorty ASC, _fullrota.fullStartTime ASC") or die(mysql_error()); // -----------------------------/select infor from mySQL ------------------------------// The problem is that i am geting the info back that i needed muitlplied by the number of enterys in the holidayrequest table. i am not to sure if this make sence i will try and explain it a bit better by an example number of holiday requests = 3 Staff name | Date --------------------- Steve | ********** Steve | ********** Steve | ********** Bert | ********* Bert | ********* Bert | ********* etc... please Help.... Neil Link to comment https://forums.phpfreaks.com/topic/73476-mysql-queary-on-php-geting-to-much-data/ Share on other sites More sharing options...
kpesanka Posted October 16, 2007 Share Posted October 16, 2007 Doing joins can often result in data sets that have rows that appear to be duplicates.. Can you pare this down into a much simpler query and result set (say using three tables and three fields on each) to make it easier to figure out? I'm guessing nobody has replied because they see that monster query and don't want to be bothered with hacking their way through it. Link to comment https://forums.phpfreaks.com/topic/73476-mysql-queary-on-php-geting-to-much-data/#findComment-370861 Share on other sites More sharing options...
nezbo Posted October 17, 2007 Author Share Posted October 17, 2007 Hi am an not to sure what you mean, do you mean put a while within a while loop type of thing? Link to comment https://forums.phpfreaks.com/topic/73476-mysql-queary-on-php-geting-to-much-data/#findComment-371389 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.