| | |
display records in textbox using combo box
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2009
Posts: 15
Reputation:
Solved Threads: 0
hi guys , i have this problem dealing with php its very simple but can anyone help me with this cause im only starting to learn this language and I don’t know where to start, its all about getting data from database using combo box , for example is when I select item in combo box it will display the price of the item into textbox and other details of the item from the database. I hope I make my self clear. Any example may do. Thank you in advance n_n
my first script
???
my first script
php Syntax (Toggle Plain Text)
$db_host = 'localhost'; $db_user = ''; $db_pass = ''; $db_db = 'Inventory'; $db_link = mysql_connect($db_host, $db_user, $db_pass) or die('MySQL Connection Error:'.mysql_error()); mysql_select_db($db_db) or die('MySQL Error: Cannot select table'); $sql = "SELECT item, id, unit_price, sellprice, quantity FROM product ORDER by id"; $result = mysql_query($sql);
Last edited by Tekmaven; Jul 1st, 2009 at 6:36 pm. Reason: Code Tags
•
•
Join Date: Jul 2009
Posts: 13
Reputation:
Solved Threads: 3
Using ajax for this would make it even nicer. Also, you're not really asking much of a valid question but are rather asking someone to write the programme for you.
Here's how you do it, in English:
You receive all item's records from the database using a MySQL statement. The data is returned in the form of an array. Using the foreach() method, you can easily populate a combo box on a form.
When the combo box form is submitted, the current item is sent using GET or POST to your script getting the rest of the details about that item and shows the page using the item's details as the initial values in your input text boxes, inside the form.
Seems like an interesting project which could even be sold eventually. Good luck with it!
Here's how you do it, in English:
You receive all item's records from the database using a MySQL statement. The data is returned in the form of an array. Using the foreach() method, you can easily populate a combo box on a form.
When the combo box form is submitted, the current item is sent using GET or POST to your script getting the rest of the details about that item and shows the page using the item's details as the initial values in your input text boxes, inside the form.
Seems like an interesting project which could even be sold eventually. Good luck with it!
![]() |
Similar Threads
- combo box error validation (ASP)
- getting records on the basis of combo box (Visual Basic 4 / 5 / 6)
- DataGridView Combo box (VB.NET)
- Pre selecting combo box in JSP (JSP)
- searching by multiple user input and display output in textbox and picture box (VB.NET)
- Combo Box problem (VB.NET)
- combo box with related records (MS Access and FileMaker Pro)
- Combo Box (C++)
- combo box (PHP)
- Want to use radio button or menu bar instead of combo box (Java)
Other Threads in the PHP Forum
- Previous Thread: videos in PHP
- Next Thread: odbc_exec problem in mysql
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





