0

I was trying get Dropdown option result in a list with respective image, but that gives other than picture...here is my partial codes, any suggestion Bro?

<?php 
$university=$_GET['university'];
$sql=mysql_query("SELECT univ FROM university WHERE univ='$university'");

while($row=mysql_fetch_assoc($sql)){        
    ?>
<li> 
 <select>
    <option value='<?php echo $row['univ'] ;?>'>
         <?php echo $row['univ'] ;?> <?php echo '<img src=abu.png width:"20"height="20">';?> 
    </option>
</select>
</li>
<?php   
}   
?>
aynber
  • 22,380
  • 8
  • 50
  • 63

1 Answers1

0

As the comments already said, your code formation is not correct. See example below for the right formation. Also a note: DONT use mysql_* anymore because it's deprecated, use mysqli_* or PDO.

<?php 
    $university=$_GET['university'];
    $sql=mysql_query("SELECT univ FROM university WHERE univ='$university'");
?>
<select>
    <?php
        while($row=mysql_fetch_assoc($sql)){        
    ?>
        <li> 
            <option value='<?php echo $row['univ'] ;?>'>
                <?php echo $row['univ'] ;?> <?php echo '<img src=abu.png width:"20"height="20">';?> 
            </option>
        </li>
    <?php   
    }   
    ?>
</select> 
S.Pols
  • 3,414
  • 2
  • 21
  • 42