html - Drop Down List and PHP -



html - Drop Down List and PHP -

i have drop downwards list select alternative , info written within retrieved database query .

<select name="moto"> <?php include 'connessione.php'; $qry = "select nomeoggetto oggetto"; $result = mysql_query($qry); while($row = mysql_fetch_array($result)) { echo '<option value='.$row["nomeoggetto"].'>'.$row["nomeoggetto"].'</option>'; } ?> </select>

the problem if in menu have name of motorbike 1 space between name , illustration ( kawasaki ninja) , when send php page post method displays kawasaki . how can show entire name space included ? php page :

<?php echo $_post['moto']; ?>

you have set quotes around attribute values in html

from

echo '<option value='.$row["nomeoggetto"].'>'.$row["nomeoggetto"].'</option>';

to

echo '<option value="'.$row["nomeoggetto"].'">'.$row["nomeoggetto"].'</option>';

php html sql select

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -