Jump to content

select


brown2005

Recommended Posts

hi i have:-

$select_type_sql = "SELECT * FROM affiliates_types ORDER BY types_name ASC;";
$select_type_result = mysql_query($select_type_sql) or die(mysql_error());

echo" <select name='types' class='text'>";
while ($select_type_array = mysql_fetch_array($select_type_result))
{
echo '<option value="'.$select_type_array['types_id '].'">'.$select_type_array['types_name'].'</option>';
}
echo"</select>";

it shows up in the combo box, but dosnt post the value...

any ideas why?
Link to comment
https://forums.phpfreaks.com/topic/8998-select/
Share on other sites

hmm.. well your code looks fine. so when you click submit and in the new page if you try to echo $types or $_POST['types'] you get nothing?

also, you are populating your dropdown with type_name but you are passing types_id with it, is this really what you are trying to do?

example: dropdown box might show Betty, Sue, George but you are actually passing 23, 19, 56 not Betty, Sue or George

if so, is types_id a valid column name in your db?
Link to comment
https://forums.phpfreaks.com/topic/8998-select/#findComment-33077
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.