I am creating a citation system for our company, and I ran into a small problem. Here is a brief summary; I have two tables, one of which is called data, the other is zip. The client enters their gender, age, if they use tobacco, zip code and condition.
Here is the data table:

Here's the zips table:

I requested two tables to join based on the zip search code. Here is the query I'm using:
SELECT data.Monthly_Rate, zips.ZIP_LOOKUP_CODE AS Expr1, zips.State, zips.County, zips.City, zips.Zipcode FROM data INNER JOIN zips ON data.ZIP_LOOKUP_CODE = zips.ZIP_LOOKUP_CODE WHERE (zips.Zipcode = '$zipcode') AND (data.Company_Old LIKE '%Blue Cross%') AND (data.Plan IN ('A','F','F (High)','G','N')) AND (data.Gender = '$gender') AND (data.Age = '$age') AND (data.Tobacco = '$tobacco') AND (data.State = '$state');
Now what I want to do is print this in php in a table. The problem I am facing is that there are several plan letters in the Plan column. I just want to return 5 different ones, but the problem is that some companies do not offer all 5 of these plans, so in this case, when I output the array, the rate for a certain plan is lined up in the wrong column in the table.
Basically, I donβt know how to correctly align the data in the specific column in which it should be. In a scenario where plan A, F, and N are available only to the company, it will fill in the first three fields, and the rate for plan N will not line up in the column of plan N.
I need to figure out how to associate a given bid with the letter Plan and correctly display it in the table. In the example below, the Plan A tariff is 111.40 US dollars, the F plan is 135.37, and the N tariff plan is 96.52 US dollars. As you can see, the Plan N speed does not align correctly. How can i fix this?
Table result:

This is what I use to output the array in PHP:
while($row = mysql_fetch_array($PlanRates)) { $Plan = "$" . number_format($row['Monthly_Rate'], 2, '.', ''); echo "<td align='center'>$Plan</td>"; } echo "</tr>"; mysql_free_result($PlanRates);