0

Here is my code:

<?php
$hostname = "localhost";
$username = "root";
$password = "";
$databasename = "change_management";    
$connect = mysqli_connect($hostname, $username, $password, $databasename);  
$query3 = "SELECT `change_id` FROM `change_request_tbl` WHERE `review_by` IS NULL";    
$result = mysqli_query($connect,$query3);
?>    
<select name="change_id">
<?php 
while ($row = mysqli_fetch_array($result))
{
echo "<option value='".$row['change_id']."'</option>";
}
?>    
</select>

As you can see, I am trying to populate the drop down menu with change_id values where the field review_by IS NULL. At the moment, the drop down menu has blank values.

What am I doing wrong?

1
  • 2
    "<option value='".$row['change_id']."'>Value</option>"; Try using this Commented Mar 7, 2017 at 10:07

1 Answer 1

2

You have missed visible value in <option>Your value here</option>

Try changing

echo "<option value='".$row['change_id']."'</option>";

To

echo "<option value='".$row['change_id']."'>".$row['change_id']."</option>";
Sign up to request clarification or add additional context in comments.

1 Comment

Simple question, simple answer. Thanks a lot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.