PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Take a look at this code, whats wrong with this? i just wanna call that list of select menu from a table, that code does but only displays the last row
i wanna display all the rows from that table.........
<?
include 'connect.php';
$result = mysql_query('SELECT * FROM ev_category order by cat_id desc');
echo "<select name=\"category\">";
while($row = mysql_fetch_array($result))
{
$a=$row[0];
$b=$row[1];
echo "<option value=\"$a\" selected=\"selected\">$b</option>";
}
echo "</select>";
?>
yeah thanks dude...and one more question
how do i use that "selected" option i mean should i use if statment, can you please give me some suggestions for that too?