I am trying to hide an element from a drop down menu if the query returns false. I have searched all day and not been able to find anything to work. I do not want to "echo" from the db query. The connection and query are successful as when I test it using echo it spits out everything as it is in the database. There are no errors. Just does not work. While typing this question it says similar question asked, however, when I went to all of the suggested via link provided... they are only similar with a few key words not the appropriate solution or the problem I am looking for. This is not a css question.
$query = "SELECT mcategory,pcategory,ecategory FROM ondash_idaccount WHERE ID = '".$_SESSION['ondashsession']."'";
$result = mysqli_query($dbcon, $query);
$mcategory = $row['mcategory'];
$pcategory = $row['pcategory'];
$ecategory = $row['ecategory'];
if( ! $result ) {
echo mysql_error($result);
exit;
}
else{
//removed css on edit of my question I need to know what to put here or in my html with php?
}
$result->free();
And for the html drop down menu:
<tr>Select One: <align="center"><select id="platform" name="platform" required><option value="">Select</option>
<label id="mcategory" style=<?php echo $mstyle?>><option value="category_m">M</option></label>
<label id="pcategory"style=<?php echo $pstyle?>><option value="category_p">P</option></label>
<label id="ecategory"style=<?php echo $estyle?>><option value="category_e">E</option></label>
</select>
Any help would be appreciated!