The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
What I want to be able to do is for each user when they view a particular page to have a pull down menu which contains the numbers from the table in the databse that apply to them. Some users will have no numbers and some users may have quite a few 10+
eg
userID | number
1......| 345
2......| 345
1......| 121
1......| 567
So when user 1 views the page they get the menu with 345, 121 and 567 in it but if user 2 views it they only get 345.
At the moment they have to enter a number from memory and I think it would be much better if they could select it from a menu, other alternative is just to display the numbers that apply to them but I feel that the pull down menu would be a better solution.
So can it be done? If so how easy would it be?
Cheers
What I want to be able to do is for each user when they view a particular page to have a pull down menu which contains the numbers from the table in the databse that apply to them. Some users will have no numbers and some users may have quite a few 10+
eg
userID | number
1......| 345
2......| 345
1......| 121
1......| 567
So when user 1 views the page they get the menu with 345, 121 and 567 in it but if user 2 views it they only get 345.
At the moment they have to enter a number from memory and I think it would be much better if they could select it from a menu, other alternative is just to display the numbers that apply to them but I feel that the pull down menu would be a better solution.
So can it be done? If so how easy would it be?
Cheers
1. Run the query SELECT number FROM table WHERE id=1; or somthing like that (haven't done SQL for a little while, so my syntax may be wrong.)
2. Output an HTML select list and form:
Sorry if I completely mess up the syntax, but like I said ... zzzzZZZZ
I was trying something very similar. But I was using a printf in the while loop so the menu was being displayed but with no entries in it.
Tried using the echo instead just there and its displaying stuff in the menu, not what I wanted though as its displaying the variable name and not what it has been assigned too. Sure its more likely something to do with my code so I'll look over it again.
Edit: Still just displaying $number instead of the actual value from the table, what I've tried hasn't worked. Going to get some sleep and give it another go tomorrow.
thanks again
----------------------
After a few little changes to the code that seemed to produce the right results.
Nice one
Much appreciated.