Current location: Hot Scripts Forums » Programming Languages » PHP » PHP Drop down


PHP Drop down

Reply
  #1 (permalink)  
Old 11-03-06, 01:36 AM
TheCase TheCase is offline
Wannabe Coder
 
Join Date: May 2006
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Drop down

Hello,

How can I create a drop down in that drop down I want it to include all the users on the table phpbb_user then define it as $dropdown so if i echo it

PHP Code:

echo "$dropdown"
It should each me back with the username selected. I really wan't to put $dropdown in a query to send the username to the db but if I echo it, this will tell me if it works.

Thanks
Reply With Quote
  #2 (permalink)  
Old 11-06-06, 09:30 AM
Crassius Crassius is offline
Newbie Coder
 
Join Date: Mar 2006
Location: Melbourne, FL
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Not sure what exactly you want, but if you want it to be a select box in a form then do:
PHP Code:

$querymysql_query("select username, id from phpbb_user table");

$dropdown .= "<select name=something><option value="">&nbsp;</option>";
while(
$bob mysql_fetch_array($query)){
   
$dropdown.= "<option value=$bob[id]>$bob[username]</option>";
}
$dropdown.= "</select>";

//wherever you want to place the drop down list.
echo $dropdown
You can then use the id post value to do whatever you want with that individual's data.
__________________
~With great power comes great responsibility.~
Reply With Quote
  #3 (permalink)  
Old 11-08-06, 06:51 AM
Shaffer Shaffer is offline
Wannabe Coder
 
Join Date: Sep 2006
Location: Israel
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Seems right, but are you sure you can access your PHPBB database?
__________________
Hello from Israel!
Reply With Quote
  #4 (permalink)  
Old 11-10-06, 09:54 AM
TheCase TheCase is offline
Wannabe Coder
 
Join Date: May 2006
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah. Thank you
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading data into a PHP script from a drop down menu MacNDaBox PHP 3 10-12-06 10:35 PM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM
Help with a PHP drop down menu! maweber98 PHP 5 06-01-05 04:02 PM
PHP Drop down list Using Oracle RatherSurf PHP 2 02-23-05 01:18 PM
Drop down list change PHP ancdy PHP 5 02-10-05 05:33 AM


All times are GMT -5. The time now is 05:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.