Hi Guys,
I have an application script in php and in one page it is having customer search option in text box.If i want to search for one customer i need to enter the customer name in text box and it will display the details and other stuff about the customer from database.Now my client want dropdown box with all the customer names existing in database so that it will be easy for them to view all the customers.
Database :- mysql
Language :- php
Variables defined
$customer = $_GET['customer'];
echo "Customer: $customer <BR>\n";
How to implement this and i really appriciate your help.
Best Regards
phpscipt for customers information from database in dropdown
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Something like
UNTESTED:
And then what ever you want to do with the list...
feyd | *grumble* tags.
UNTESTED:
Code: Select all
print(' <select name="select" id="select">' );
$query = mysql_query("SELECT customer_name FROM databasetable ORDER BY customer_name");
$customers = mysqk_fetch_array();
foreach($customers['customer_name'] as $name){
print("<option>$name</option>");
}
print('</select>');feyd | *grumble* tags.