 |
| ::: T4VN Statistics ::: |
PHP Scripts : 64 |
PHP Example : 67 |
PHP Tutorials : 21 |
PHP News : 93 |
Total Coupon : 36 |
Other Tutorials : |
Member : 215 |
Visitor Online : 3 |
Today Visit: 286 |
Total Visitor : 301308 |
Most Online : 41 |
|
 |
 |
Select Menu out of MySql
Author : alxg
This function builds select menu out of MySql table
and leaves the selected value active.
| PHP Example : | | <?php
function selectmenu($selected_value,$query,$selectname,$topoption)
{
$result = mysql_query($query);
echo '<select name="'.$selectname.'">';
echo '<option> ---'.$topoption.' --- </option>';
while($row = mysql_fetch_array($result))
{
echo '<option value="';
echo $row[0];
echo '" ';
if($row[0]==$selected_value)
{
echo 'selected';
}
echo '>';
echo $row[1];
echo '</option>';
}
echo '</select>';
}
?>
| |
| |

|
 |
| ::: Resources ::: |
|
|
| ::: New Templates ::: |
|
| ::: Other Tutorials ::: |
|
 |