Will_S
Will_S

Reputation: 71

PHP post method only showing the first word?

Can someone see where I have gone wrong? I have

                echo'<option value='.$row['car'].'>'.$row['car'].'</option>';               
            }
?>          
            </select>

I want to display the whole word in $row['car'].

Upvotes: 0

Views: 1275

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324750

You MUST have quotes around your attributes if they contain more than one word.

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

Upvotes: 5

Related Questions