| | |
Convert database values into Dropdown List
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Mar 2007
Posts: 5
Reputation:
Solved Threads: 0
Hi Guys, new to this forum, kinda new to PHP in general haven't been using it long, mostly creating forms for database and custom CMS modules.
Anyway, i'm building a html email tool from the ground up and just need some help with one thing.
How do i convert values from a database field into a html form drop-down list?
I want to make a the list that display individual users and if you select a user, the value becomes that users email address
Anyway, i'm building a html email tool from the ground up and just need some help with one thing.
How do i convert values from a database field into a html form drop-down list?
I want to make a the list that display individual users and if you select a user, the value becomes that users email address
•
•
•
•
Hi Guys, new to this forum, kinda new to PHP in general haven't been using it long, mostly creating forms for database and custom CMS modules.
Anyway, i'm building a html email tool from the ground up and just need some help with one thing.
How do i convert values from a database field into a html form drop-down list?
I want to make a the list that display individual users and if you select a user, the value becomes that users email address
If you want to know how to create the drop down menu using php - go through the threads from last week - I think there is at least 2 posts with the same problem. For the JS script - it is a completely different story.
Good luck.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
I miss my mind the most...."
Mark Twain
•
•
•
•
Hi Guys, new to this forum, kinda new to PHP in general haven't been using it long, mostly creating forms for database and custom CMS modules.
Anyway, i'm building a html email tool from the ground up and just need some help with one thing.
How do i convert values from a database field into a html form drop-down list?
I want to make a the list that display individual users and if you select a user, the value becomes that users email address
1) How to Query the Database with PHP.
2) The structure of the HTML <select> field (drop-down list)
Assuming you're using MySQL database, look here for the functions:
http://php.net/mysql
Lets say you have a Table: Users with columns username, and email
The SQL to select usrs and email would be:
[PHP]$sql = "select username, email from Users LIMIT 10";[/PHP]
The Structure of the HTML <select> is:
[PHP]
<select name="box_name" id="box_id">
<option value="value1">Label 1</option>
<option value="value2">Label 2</option>
</select>[/PHP]
You'll probably want to generate something like:
[PHP]<select name="user_email" id="user_email">
<option value="email1">User Name 1</option>
<option value="email2">User Name 2</option>
</select>[/PHP]
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
You're welcome.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- get data from database in dropdown list (C#)
- php script for dropdown to fetch DB list and then Tables (PHP)
- Dropdown list Last value (ASP.NET)
- Retrieving Multiple Columns into Dropdown List (ASP.NET)
- DropDown List (VB.NET)
- Feeding a value in a dropdown list to another dropdown list (PHP)
Other Threads in the PHP Forum
- Previous Thread: How to enable PDF in PHP?
- Next Thread: question about php string function
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parameter parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube






