I am creating a page where I can list all of my jobs, both current and past, and the various raises/promotions from each. I would love to have the basic job information listed and then in a separate DIV list all the promotions. My problems arise when I loop them. For every job I want there to be multiple wage listings, but what is happening is that if I have more than one raise, it will list the Job Info for each wage increase. How do I get it to work the way I want it?
Here are the columns for each DB:
JobInfo ID | LocName | Address | Phone
JobPromotions ID | JobID | Date | Wage | Position
And my code:
<div id="CurrentJobs">
<?php
$CurrentJobsResults = mysql_query("
SELECT JobInfo.*, JobPromotions.*
FROM JobInfo
LEFT JOIN JobPromotions
ON JobInfo.ID=JobPromotions.JobID
WHERE JobInfo.DateEnd = '0000-00-00'
");
while ($row = mysql_fetch_array($CurrentJobsResults)) {
echo "
<div class='JobItem'>
<div class='JobItem_Gen'>
<b>{$row['LocName']}</b>
<p>{$row['Street']}</p>
<p>{$row['City']}</p>
<p>{$row['State']}</p>
<p>{$row['Zip']}</p>
<p>{$row['Phone']}</p>
</div>
<div class='JobItem_Prom'>
<p>{$row['Date']}</p>
<p>{$row['Position']}</p>
<p>{$row['Wage']}</p>
</div>
</div>
";
}
?>
</div>
Any help would be much appreciated as this is getting annoying!
Thanks!