RE: [PHP] Combo box selected value...
Sounds like you are working on a windows box with a bad battery back up for the clock! Bruce Karstedt President Technology Consulting Associates, Ltd. Tel: 847-735-9488 Fax: 847-735-9474 -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 4:01 PM To: Alexandra Aguiar Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Combo box selected value... On Fri, 4 Jan 1980, Alexandra Aguiar wrote: I got the followin code to generate a combo box... Your clock is off by about 20 years. Is it possible to fix it before posting to the list? Thanks. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Combo box selected value...
select name='.$nome.' size=1'); echo(\n); while ($cont $quant) { echo(\n); if ($blah == $bleh) { echo(' option value='.mysql_result($resultado, $cont,$letra).' selected'.mysql_result($resultado, $cont,$letra).'/option'); } else { echo(' option value='.mysql_result($resultado, $cont,$letra).''.mysql_result($resultado, $cont,$letra).'/option'); } $cont++; } echo(\n /selected); } } +++ But, how can i return the selected item value into a variable $var ??? That's normally how I do it... I'm not to sure on which values you need to do the comparison... It depends on what data you are returning from mysql I think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Combo box selected value...
the value is returned in whatever is stored in $nome. So, if $nome=var, then $var will contain the selected value. - Original Message - From: Alexandra Aguiar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 04, 1980 12:56 PM Subject: [PHP] Combo box selected value... Hi ppl... I got the followin code to generate a combo box... ++ function comb_alfabeto( $resultado, $nome, $letra) { global $error; $quant = mysql_num_rows($resultado); If ($quant == 0) { $error-erro(); } Else { // Início da combbox $cont=0; echo(' select name='.$nome.' size=1'); echo(\n); while ($cont $quant) { echo(\n); echo(' option value='.mysql_result($resultado, $cont,$letra).''.mysql_result($resultado, $cont,$letra).'/option'); $cont++; } echo(\n /selected); } } +++ But, how can i return the selected item value into a variable $var ??? thnx in advance... Alexandra
Re: [PHP] Combo box selected value...
The value is returned in whatever is stored in $nome. So, if $nome=var, then $var will contain the selected value. Second, this could not possibly operate the way you want it to, because the mysql_result() is called TWICE with each line. You want it called only ONCE to retrieve the value for the VALUE parameter and the value displayed. - Original Message - From: Alexandra Aguiar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 04, 1980 12:56 PM Subject: [PHP] Combo box selected value... Hi ppl... I got the followin code to generate a combo box... ++ function comb_alfabeto( $resultado, $nome, $letra) { global $error; $quant = mysql_num_rows($resultado); If ($quant == 0) { $error-erro(); } Else { // Início da combbox $cont=0; echo(' select name='.$nome.' size=1'); echo(\n); while ($cont $quant) { echo(\n); echo(' option value='.mysql_result($resultado, $cont,$letra).''.mysql_result($resultado, $cont,$letra).'/option'); $cont++; } echo(\n /selected); } } +++ But, how can i return the selected item value into a variable $var ??? thnx in advance... Alexandra
Re: [PHP] Combo box selected value...
On Fri, 4 Jan 1980, Alexandra Aguiar wrote: I got the followin code to generate a combo box... Your clock is off by about 20 years. Is it possible to fix it before posting to the list? Thanks. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php