Re: dropdown with two Sql query
| From: | Jim Giner | Date: | Sun, 26 Jun 2011 14:34:54 +0000 |
| Subject: | Re: dropdown with two Sql query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313722@lists.php.net to get a copy of this message | ||
I don't even understand what the first two code blocks are saying. Looks
like html, but I have never seen it like that. I also don't see the two
fields you specifically mention to start in your first select statement -
some other garbled names are there instead. Are you sure you've copied this
correctly?
"asp kiddy" <aspkiddy@hotmail.com> wrote in message
news:SNT106-W94D445760F0A991221EBED6550@phx.gbl...
In this table (tb_code_prmtn11_email) I have two field :
fld_email_id
fld_name_email
It works here is a code
------------code-------------------->
<select name="email_adress_menu" id="email_adress_menu"
class="valid"
onchange="submit()">
<?php
echo "<option selected=\"selected\" value=''>Choose your
name</option>";
$req_email_adress_menu = "SELECT DISTINCT id_email, fld_name_email,
fld_adresse_email FROM $table_db_email ORDER BY fld_name_email ";
$rep_email_adress_menu = mysql_query($req_email_adress_menu, $cnx) or
die( mysql_error() ) ;
while($show_email_adress_menu = mysql_fetch_assoc($rep_email_adress_menu))
{
echo '<option
value="'.$show_email_adress_menu['id_email'].'"';
//if($primes==$show_email_adress_menu['fld_name_email']){echo "
selected";} //display to select an option!!!!!!!!!!!!!!!!
echo '>'.$show_email_adress_menu['fld_name_email'].' -
'.$show_email_adress_menu['fld_adresse_email'].'</option>';
}
?>
</select>
<-----end----code--------------------