G'day all:
I have a small array pulled form a DB table, and I want to know how one can reference the array by name (like a variable in JavaScript)
Here is my code:
while ($row = mysql_fetch_array($result)) {
$evtTSport = $row['evtTSport'];
$evtTDate = $row['evtTDate'];
$Tvenue = $row['Tvenue'];
$evtTTeam = $row['evtTTeam'];
$TDescription = $row['TDescription'];
$evtTTitle = $row['evtTTitle'];
if (empty($username)) {
$Tvenue = "Restricted info";
}
if (empty($username)) {
$evtTTeam = "Restricted info";
}
If the number of fields in the table increases, I do not wish to have to add another if-else statement (as-above) each time I wanted to echo: "Restricted info" for it.
Any ideas??
Cheers:
Russ