Jump to content

Easy Fix im assuming


justinjkiss

Recommended Posts

OK below is my code. the values for $row['state'] are in this format "AL - Alabama" its got the space in it.

 

													
while($row = mysql_fetch_array($result))
{
echo "<option value=" . $row['state'] . '">' . $row['state'];
}
?>

 

When i run the script it outputs HTML as this

<option value="AL" -="" alabama"="">AL - Alabama</option>

 

As you can see at the space it terminates and puts the " in. Im assuming this is a rookie programming mistake.

 

Please help,

Justin

 

Link to comment
https://forums.phpfreaks.com/topic/258945-easy-fix-im-assuming/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.