 |
| ::: T4VN Statistics ::: |
PHP Scripts : 35
|
PHP Example : 67
|
PHP Tutorials : 21
|
PHP News : 91
|
Total Coupon : 36
|
Other Tutorials :
|
Member : 168
|
Visitor Online : 1
|
Today Visit: 256
|
Total Visitor : 88106
|
Most Online : 25
|
|
|
 |
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 ::: |
|
|