That shouldn't have made any difference. This is a perfectly valid ternary.
$boxcont .= "<td class='list1'>".($routes2show['routes_lube'] == "0") ? 'none' : 'lubed'."</td>";
it's equivalent to this.
if ($routes2show['routes_lube'] == "0") {
$boxcont .= 'none';
}
else {
$boxcont .= 'lubed';
}
I only see two things:
1. The variable may not be SET. This can be tested with isset.
2. You are evaluating an integer as a
string by quoting it.
Both together try this:
$boxcont .= "<td class='list1'>".(isset($routes2show['routes_lube']) and ($routes2show['routes_lube'] == 0)) ? 'none' : 'lubed'."</td>";
A better choice would be to check for the row values **before** you get to this part, for example,
$boxcont .= "<td class='list1'>";
if (isset($routes2show['routes_lube']) {
$boxcont .= ($routes2show['routes_lube'] == 0) ? 'none' : 'lubed';
}
else { $boxcont .= 'N/A'; }
$boxcont .= "</td>";
If that "N/A" is not supposed to be there, it will give you a clue something is wrong with the data.
[edited by: rocknbil at 5:44 pm (utc) on Feb 13, 2012]