php - Dynamic Dropdown option in a list with image -
i trying dropdown option result in list respective image, gives other picture...here partial codes, suggestion bro?
<?php $university=$_get['university']; $sql=mysql_query("select univ university 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 } ?>
as comments said, code formation not correct. see example below right formation. note: dont use mysql_*
anymore because it's deprecated, use mysqli_*
or pdo
.
<?php $university=$_get['university']; $sql=mysql_query("select univ university 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>
Comments
Post a Comment