|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
PHP, MySQL, and Dropdown lists
I have a question. Is it possible to get all the fields from a table inside a MySQL database, and display 'em, one by one, inside a dropdown list? I'm pretty sure it is, but I don't want to do 3+ hr.'s of coding to find out it won't work.
|
|
#2
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
|
|
#3
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
![]() I'll try that and see what happens. |
|
#4
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
PHP Code:
|
|
#5
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Thank you
![]() What I mean here though (I dunno if you stated this, I'm really tired today so...), is something like this: Inside a table (named "Bob"), there's 4 fields ("Hi", "I", "Love", "ChiefDelphi"). what I want to do is search through Bob, and for each field, I want to put each into a dropdown list. So, the choices would be like: "Hi", then next one is "I", then "Love", finally "ChiefDelphi". |
|
#6
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
|
|
#7
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
After trying your code, I realized it's not exactly what I'm looking for. I'm trying to directly output the fields, not the field values.
|
|
#8
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
|
|
#9
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
But a new question has arisen. My question now is, I need to get the value from the field after clicking on the submit button. Here's my code: PHP Code:
Mainly, I just need to select the correct belt from the table, and output who owns it so far. I don't mean to be seeming like I'm asking how to do this whole thing, I've just been working on this for the whole day, and it's starting to get underneath my skin here. ** PS: I know it sounds like wrestling here, I'm helping a friend on a summer project ** |
|
#10
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
NOTE: This news script cannot be used directly, there are still a few errors. If you look at the code under the if($action == "edit") section, you will see where a form is outputted. The following is a line of code from that, the name of the variable is modified for clarity: PHP Code:
Last edited by Joshua May : 28-06-2004 at 19:54. |
|
#11
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
So you have a table of just people that own belts? Interesting. I'd have just made a new row in your wrestler table (I'm assuming you have one) named like belt_owned. Then you could have done something like SELECT DISTINCT wrestler_name,belt_owned FROM wrestlers WHERE belt_owned IS NOT NULL. But maybe I'm missing something. And I didn't even answer your question. Or was it already answered. I got so lost in that post that I don't even remember the problem
I just got home from work.. so.. uhh *runs into wall and falls over* |
|
#12
|
||||
|
||||
|
Re: PHP, MySQL, and Dropdown lists
Quote:
|
|
#13
|
|||||
|
|||||
|
Re: PHP, MySQL, and Dropdown lists
Ahh yes -- I knew there was a function, just couldn't find it in the 3-second attention span I allotted myself ..
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|