Can someone please help me to adding the str_replace function in this short piece of code to the query that creates the drop down below. I have been pulling my hair out over this. I keep getting Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'
with everything i try.
It is really appreciated.
Thank you
<select id="dd" name="dd">
<option value="<?php echo $databaseID1;?>"
<?php echo str_replace(" ", "*", $databaseValue1);?>
</option>
#######################################################################
<? $query_s="SELECT * FROM schools ORDER BY school DESC";
/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */
$result_s = mysql_query ($query_s);
echo "<select id= 'dropdown-style' name=school value='school'>school</option>";
// printing the list box select command
while($nts=mysql_fetch_array($result_s)){//Array or records stored in $nts
echo "<option value=$nts[school]>$nts[school]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
?>
when i added the quotes it wont work. I am really trying to add spaces to the option value item that are pulled from the database
with everything i try.
It is really appreciated.
Thank you
<select id="dd" name="dd">
<option value="<?php echo $databaseID1;?>"
<?php echo str_replace(" ", "*", $databaseValue1);?>
</option>
#######################################################################
<? $query_s="SELECT * FROM schools ORDER BY school DESC";
/* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */
$result_s = mysql_query ($query_s);
echo "<select id= 'dropdown-style' name=school value='school'>school</option>";
// printing the list box select command
while($nts=mysql_fetch_array($result_s)){//Array or records stored in $nts
echo "<option value=$nts[school]>$nts[school]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
?>
when i added the quotes it wont work. I am really trying to add spaces to the option value item that are pulled from the database