First of all, please forgive my immature code.. I am a beginner and this is my first one.
Could some body take a look at this and tell me why the data in my table is not populating?
Thanks in advance for your time.
The problem I am having is all variables are populating, with the exception of variables 20-24. Variables 1-19 are coming from a table called tblLodges and variables 20-24 are coming from a table called tblOfficers
$id = $_GET['id'];
$query = mysql_query("SELECT a.strLodgeName, a.intLodgeNumber, a.strDistrictName, a.strLodgeWEB, a.strLodgeCounty, a.dtChartered, a.strLodgeMailingAddress, a.strLodgeMailingAddress2, a.strLodgeMailingCity, a.strLodgeMailingStateCode, a.strLodgeMailingPostCode, a.strLodgeEmail, a.strLodgePhone, a.strLodgeFax, a.strDrivingDirectons, a.dtMeetingTime, a.dtMealTime, a.strFloorSchool, a.strLodgeNews, b.strOfficerTitle, b.strFirstName, b.strLastName, b.BusinessPhone, b.PersEmail FROM tblLodges a LEFT JOIN tblOfficers b ON a.lngLodgeID = b.lngLodgeID WHERE a.intLodgeNumber=$id GROUP BY a.strLodgeName LIMIT 50")or die(mysql_error());
while ($row = @mysql_fetch_array($query))
{
$variable1=$row["strLodgeName"];
$variable2=$row["intLodgeNumber"];
$variable3=$row["strDistrictName"];
$variable4=$row["strLodgeWEB"];
$variable5=$row["strLodgeCounty"];
$variable6=$row["dtChartered"];
$variable7=$row["strLodgeMailingAddress"];
$variable8=$row["strLodgeMailingAddress2"];
$variable9=$row["strLodgeMailingCity"];
$variable10=$row["strLodgeMailingStateCode"];
$variable11=$row["strLodgeMailingPostCode"];
$variable12=$row["strLodgeEmail"];
$variable13=$row["strLodgePhone"];
$variable14=$row["strLodgeFax"];
$variable15=$row["strDrivingDirectons"];
$variable16=$row["dtMeetingTime"];
$variable17=$row["dtMealTime"];
$variable18=$row["strFloorSchool"];
$variable19=$row["strLodgeNews"];
$variable20=$row["strOfficerTitle"];
$variable21=$row["strFirstName"];
$variable22=$row["strLastName"];
$variable23=$row["BusinessPhone"];
$variable24=$row["PersEmail"];
//layout for Lodge Information results
echo ("<tr>");
echo "<center>\n";
echo "<p>GRAND LODGE OF LOUISIANA - LODGE LOCATOR RESULTS\n</p>";
echo "Lodge Name:$variable1</p>";
echo "<p><b>Lodge Number:</b> $variable2</p>";
echo "<p><b>District Name:</b> $variable3</p>";
echo "<a href=\"$variable4\">Click Here To Go To The Lodge Website</a>";
echo "<p><b>Lodge County:</b> $variable5</p>";
echo "<p><b>Lodge Chartered On:</b> $variable6</p>";
echo "<p><b>Lodge Address:</b> $variable7, $variable8</p>";
echo '<p>' . $variable9 . $variable10 . $variable11 . '</p>';
echo "Click Here To Email The Lodge";
echo "<p>Lodge Phone Number: $variable13, Lodge FAX Number: $variable14</p>";
echo "<p>Lodge Driving Directions: $variable15</p>";
echo "<p>Lodge Lodge Meeting Time: $variable16</p>";
echo "<p>Lodge Lodge Meal Time: $variable17</p>";
echo "<p>Lodge Floor School: $variable18</p>";
echo "<p>Lodge News: $variable19</p>";
echo "<img src='{$row['link']}'>";
echo "</center>\n";
echo ("</tr>");
}
//Layout for Officers Table Results
echo "<center>\n";
echo "<H2>Roster of Lodge Officers</H2>\n";
echo "<table border='1'>
<tr>
<th>Officer Title</th>
<th>Officer First</th>
<th>Officer Last</th>
<th>Officer Email</th>
<th>Officer Phone</th>
</tr>";
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_array($query)){
$variable20=$row["strOfficerTitle"];
$variable21=$row["strFirstName"];
$variable22=$row["strLastName"];
$variable23=$row["PersEmail"];
$variable24=$row["BusinessPhone"];
//table layout for results
print ("<tr>");
echo "<tr align=\"center\" bgcolor=\"#EFEFEF\">\n";
echo "<td class=\"td_id\">$variable20</td>\n";
echo "<td class=\"td_id\">$variable21</td>\n";
echo "<td class=\"td_id\">$variable22</td>\n";
echo "<td class=\"td_id\">$variable23</td>\n";
echo "<td class=\"td_id\">$variable24</td>\n";
print ("</tr>");
}
}
?>