<?php
$sample = 0;
if($sample ==0)
{
$displayinner = '<option value =' . $row['privilege_ID'] . '>' . $row['privilege_name'] . '</option>';
$displayouter = '<td><label>Privileges:</label></td>
<td><select name = "Privilege" id = "Privilege" multiple="multiple">
<?php
$PrivilegeNames = mysql_query("SELECT * FROM privilege");
while($row = mysql_fetch_array($PrivilegeNames))
echo $displayinner;
?>
</select></td>
</tr>
<tr>';
echo $displayouter;
}
?>
I only get a dropdownbox without any data inside it. Please help, what am i doing wrong?
mysql_*functions in new code. They were removed from PHP 7.0.0 in 2015. Instead, use prepared statements via PDO or MySQLi. See Why shouldn't I use mysql_* functions in PHP? for more information.