Hi all:
I am building a dynamic drop down. My goal is to have some of the names in the drop down to be highlighted in red instead of black. The names will appear red if they are flagged in the DB table where "listingType = 'S'".
I've got the drop down working except the names are appearing in red where they should be. All are in black. Any help appreciated. I have been on this for about 4 hours and am numb!!!!
<?php
$queryPlayerSuper = "
SELECT
DISTINCT
player
FROM
events
WHERE
startDate <= CURDATE() AND
eventDate >= CURDATE() AND
listingType = 'S' AND
hold IS NULL
ORDER BY
player
";
$resultPlayerSuper = mysqli_query($link, $queryPlayerSuper);
$queryPlayer = "
SELECT
DISTINCT
player
FROM
events
WHERE
startDate <= CURDATE() AND
eventDate >= CURDATE() AND
hold IS NULL
ORDER BY
player
";
$resultPlayer = mysqli_query($link, $queryPlayer);
echo "<select name='player' size='1'>\r\n";
echo "<option></option>\r\n";
while($rowPlayer = mysqli_fetch_array($resultPlayer, MYSQLI_ASSOC)){
while($rowPlayerSuper = mysqli_fetch_array($resultPlayerSuper, MYSQLI_ASSOC)){
$vSuperFound = 0;
if (($rowPlayer["player"]) == ($rowPlayerSuper["player"])){
$vSuperFound = 1;
} // Close if (($rowPlayer["player"])
} //Close while($rowPlayerSuper
if ($vSuperFound == "1"){
$vColor = "color: #FF0000";
} else {
$vColor = "color: #000000";
$vSuperFound = 0;
} // if ($vSuperFound == "1"){
echo "<option style='" . $vColor . "'>" . $rowPlayer["player"] . "</option>\r\n";
} // Close while($rowPlayer = mysqli_fetch_array($resultPlayer, MYSQLI_ASSOC)){
echo "</select>\r\n";
mysqli_free_result($resultPlayerSuper);
mysqli_free_result($resultPlayer)
?>