Jump to content

drop down list


jagguy

Recommended Posts

[code]

<?php

$db=mysql_connect('localhost' , 'xxxxxx' , 'xxxxxx' );
mysql_select_db('xxxxxx',$db);

$query="select from xxxxxx where xxxxx='xxxxx'";

$result=mysql_query($query);

echo"<select name='xxxxxx'>";

while($record=mysql_fetch_assoc($result)){

echo" <option value=' '".$record['xxxx']."'
'>'".$record['xxxxx']."'</option>";
}

echo"</select>";

?>[/code]



array way ok.

[code]

<?php

$x=array('php','asp','javascript');

echo"<select name='x'>";

foreach($x as $d){

echo"<option value='$d'>$d</option>";
}
echo"</select>";
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/25790-drop-down-list/#findComment-117764
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.