USING A DATABASE VARIABLE INSIDE AN OPTION VALUE IN A DROP DOWN BOX?

Question by shortpc89:
Using a database variable inside an option value in a drop down box?
I want to put a drop-down box on my gaming site. The user will be able to click on the box and the box will drop down and show a list of games that are in the database. Each game listed in the box will have a link to it. The link will be generated based on the ID of the game in the database.
At the moment, the code I have right now is this:
The Javascript:
The dropdown box:
The problem is that when it shows up on my site, the actual names of the games do not show up. Instead the code shows up. For instance, ” .$ row['gameName']. ” will loop itself over and over again int he menu and the link, when clicked on, will look like this: http://www.mmocraze.com/game-directory/game-profile/?gameId=” .$ row[
Here's the code my friend sent me (without the javascript and action page (haven't tried it yet):
Can anyone help me with this?
——————————————
Answer by Riley
this is usually because you have not shut with a ” or ‘ can you link me?
——————————————
Give your own answer to this question below!









about 1 year ago
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
about 1 month ago
Can’t be sure, code looks OK. It might be this line
$ row['gameName']= str_replace(‘ ‘, ‘-’, $ row['gameName']);
try using variables rather than updating the $ row. It might be that something is weird when you’re doing the str_replace.
(So yeah use your friend’s code – it’s easier to read.)
Or else it’s in there:
echo “
We don’t know what Yahoo has stripped out.