need help with an IF
Posted: Sat Nov 11, 2006 3:10 pm
Ok I am still new to PHP and am having trouble with this "if"
It should only display the table and info if $mem_type == Family, if $mem_type is anaything else I want it to do nothing. But I am always seeing the table, but the display of SQL results is working as it should. (not seeing when $mem_type does not == Family)
What did i do wrong?
It should only display the table and info if $mem_type == Family, if $mem_type is anaything else I want it to do nothing. But I am always seeing the table, but the display of SQL results is working as it should. (not seeing when $mem_type does not == Family)
What did i do wrong?
Code: Select all
<?php
// Chech to see if membership type is Family, if ttrue return all family members name and call in HTML table.
// Get a specific result from the table
if ($mem_type == Family)
$result = mysql_query("SELECT pn_name, pn_uname FROM _users WHERE barc_id='$barc_id'")
or die(mysql_error());
echo "<br /><table width=\"250\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<caption><b>All Family Members</b></caption>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table><br />\n";
?>