This is my first time working with JOIN.
First let me display the code:
$queryimg2 = "SELECT `serv_dur4`.`site`, `serv_dur4`.`service`, `serv_dur4`.`t1m3`, `site_n4m3`.`id`, `serv_typ3`.`id`
FROM `serv_dur4`
INNER JOIN `site_n4m3` ON (`serv_dur4`.`site`=`site_n4m3`.`id`)
INNER JOIN `serv_typ3` ON (`serv_dur4`.`service`=`serv_typ3`.`id`)
ORDER BY `serv_typ3`.`nam3` ASC";
$resultimg2 = mysql_query($queryimg2)or die( mysql_error() . "<HR>".$queryimg2);
while($img2 = mysql_fetch_row($resultimg2)){
// $hours = $img2['serv_dur4.t1m3'];
echo "<tr><td><td>" . $img2['serv_dur4.t1m3'] . "";
}
I have been spending hours today on Google researching the crap out of this thing and can't seem to get it working.
I'm wanting this to output a matrix / table. This table is meant to be a matrix to show how long a service typically takes to do depending on the job site and the type of service that is being done there. The best way I could pull this off was using JOIN (or in my specific case, INNER JOIN) to spit out rows of the results. But I have been running into massive bumps along the way.
My initial dream was this to look like a real table with the job sites lining up along the top horizontal row (pardon, I can't remember which is the X/Y axis) and the types of services line up on the far left vertical row with all of the cells filled with the time durations. I couldn't get that to work so now I'm working on having the results just spit out in a long vertical line. If there is some way to make it happen the way my original plan was, please do let me know.
Anyways, I have been fighting with this using every single trick Google has shown me (again, spending hours and hours searching, reading forums, reading tutorials, reading discussions, etc) but there doesn't seem to be a single case that matches mine for some reason.
The problem is the coding is not outputting anything, not even error messages. I've tried various ways to set up the SQL code, nothing changed. I tried various ways to get PHP to display the results, nothing changed. I'm using XAMPP on my local drive, if that has anything to do with it (I tried Googling if XAMPP has JOIN turned off [i know with email functions it does have that off] but couldn't find anything about that either).
Any clue as to what will get this thing to pump out the results?