Link to home
Start Free TrialLog in
Avatar of funkkube
funkkubeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP Combo Box Default Nothing value

I ahve this

<select name="comboname">
<?php
  $result = mysql_query('select * from combovalues');
  while ($row = mysql_fetch_assoc($result)) {
   echo '<option value="'.$row['combovalue'].'">'.$row['combovalue'].'</option>';
  }
?>
</select>

What do I need to add to make the combo box default to blank..

Cheers
Mat
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

It will default to "nothing" if there is no selected value.
When you are testing HTML forms with PHP, you can use the var_dump() command to visualize the contents of $_GET and $_POST - that way you can see exactly what your form sent to the script.
ASKER CERTIFIED SOLUTION
Avatar of john-formby
john-formby
Flag of Ghana image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of funkkube

ASKER

Hi
I added the PLEASE SELECT in and it didn't do anything...
It is what i wnat but it didnt change the box...
??
@funkkube: Please post the code you're using now in the code snippet.  I will show you the correct way to handle this.  Thanks, ~Ray
sorry it is working !!!
[quote]sorry it is working !!![/quote]

Great :-)