...

View Full Version : call from databse



kawe
08-31-2006, 11:23 AM
i have some data for example :

data_name value
place USA
place UK
place RUSIA
place CHINA
place JAPAN

so how i can call from database this data into select, radio and check box.

for example: place: <select name=place>
<option value=USA>USA</option>
<option value=USA>USA</option>
<option value=USA>USA</option>

and more ....

kaydara
08-31-2006, 12:15 PM
well you need to query your db, and then loop in your results and create the options for the select ?
think that there is no other way, so you have to do it. No magic here :)

guelphdad
08-31-2006, 01:02 PM
Please do not post the same questions in multiple forums. The one in mysql has been deleted so all your answers will end up in one thread.

amir
08-31-2006, 01:16 PM
# to display data in select box

$data = $dblink->getTableFromDB("select * from oes_courses");

<select name="student_course" class="selectbox">
<option>Select...</option>
<?
$i = 0;
while($data[$i])
{
?>
<option><? echo $data[$i]['courseName']; ?></option>
<?
$i++;
}
?>
</select>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum