How do I get the database to display only certain fields. I have a db that people can choose to have thier info displayed or not on the roster. here is the code so far...
$results = mysql_query("SELECT * FROM `sda` WHERE `rostar` =1 ORDER BY `LastName` ASC LIMIT $current_record, $limit");
if (mysql_num_rows($results) > 0) //test that its > 0
{
while($row = mysql_fetch_array($results))
{ echo "<tr valign=top><td><strong>" . $row["LastName"] .", " . $row["FirstName"] . "</strong></td><td>" . $row["ID"] . "</td><td>" . $row["EmployerAddress"] . "<br>" . $row["EmployerCity"] . "<br>" . $row["EmployerPostalCode"] . "</td><td><strong>H:</strong> " . $row["HomePhone"] . "<br><strong>H-Email:</strong> " . $row["HomeEmailAddress"] . "<br><strong>W:</strong> " . $row["WorkPhone"] . "<br><strong>W-Fax:</strong> " . $row["WorkFax"] . "<br><strong>W-Email:</strong> " . $row["WorkEmailAddress"] . "</td><td>" . $row["PositionTitle"] . "<br>" . $row["EmployerName"] . "</td></tr>";
// and so forth
// close the while loop
}
}
else
echo "There are no records in the Table SDA";
echo "</table>";