I have a select option form in php/html. In the selection option forms I put php like this:
<option name="time" value="0900"><?php $a=$r1; echo $a;?></option>
Above it I need some php code to do the following:
Search my database for the value 0900; if it is found, give the variable $r1 a NULL value so that the option does not appear, otherwise give it the value of 0900.
Basically, what I need is for someone to tell me how I can search for a value in my database and give a variable a value accordingly. Thanks in advance.
edit: This is a bit of what I have
$conn= new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT time FROM Guidance";
$result = $conn->query($sql);
The only thing under time in my database is 'volvo'; but when I echo $result, I get nothing. Why?