Here is a code snippet:
$con = mysql_connect("localhost:8888", "root", "root");
mysql_select_db("movedb", $con);
$interestData = mysql_query("SELECT * FROM `Interests`") or die(mysql_error());
$interestCategories = mysql_query("SELECT * FROM `Occupational Interest Categories`") or die(mysql_error());
echo '<ol id="occupationalInterestsList">';
while($interestDataRow = mysql_fetch_array($interestData)) {
if($interestDataRow['O*NET-SOC Code']==$careerSOC && $interestDataRow['Scale ID']=='OI' && $interestDataRow['Data Value']>=3.5) {
echo '<li><h3>' . $interestDataRow['Element Name'] . '</h3></li><br />';
while($interestCategoriesRow = mysql_fetch_array($interestCategories)) {
if($interestCategoriesRow['OI Name']==$interestDataRow['Element Name']) {
echo '<ul><li><p style="margin-right:75px;">' . $interestCategoriesRow['OI Description'] . '</p></li></ul>';
}
}
}
}
echo '</ol>';
I would expect this code to output:
Matching Occupational Interest One
Interest Description
Matching Occupational Interest 2
Interest Description
Matching Occupational Interest 3
Interest Description
Instead, it only prints the first Interest Description. So it looks like this:
Matching Occupational Interest One
Interest Description
Matching Occupational Interest 2
Matching Occupational Interest 3
I'm pulling my hair out! Any help would be greatly appreciated.
Philip