473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

retrieve value from DB & display in textboxes based on value selected from dropdown

Expand|Select|Wrap|Line Numbers
  1. <select name="goods_id"> <option><strong>--SELECT--</strong></option> <?php $goods_query=mysql_query("select goods_id from booking_info") or die(mysql_error());
  2.                             while($fetch_goods_id=mysql_fetch_array($goods_query))
  3.                             {
  4.                                 echo '<option>';
  5.                                 echo $fetch_goods_id['goods_id'].'<br/>'; 
  6.                                 echo '</option>';
  7.                             } ?> </select>
  8.  
  9.  
  10. $goods_id=$_POST['goods_id'];
  11.                     $booking_query=mysql_query("select * from booking_info where goods_id='$goods_id' ") or die(mysql_error());
  12.                     while($fetch_booked=mysql_fetch_array($booking_query))
  13.                     {    ?> <input type="text" value="<?php $fetch_booked['cus_locality']; ?>">
Jun 25 '13 #1
4 9377
Rabbit
12,516 Expert Mod 8TB
And what problem are you having?
Jun 25 '13 #2
In selection box values get from db, based on the selection value to get other values in textbox. I wrote in page load itself. I have an error as "undefined index" in php
Jun 26 '13 #3
Please help me...
goods_id is name of combo box, i am using this goods_id to fetch data from mysql and display the value in textboxes. I know the problem when page load itself nothing values to be selected in combox box. then how can fetch the data. please help me
Jun 26 '13 #4
Rabbit
12,516 Expert Mod 8TB
Skip the loading of the other combo box when the goods_id isn't set.
Jun 26 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mwagoner | last post by:
I am trying to display the value of a true/false value in my table through the use of the following: <input type=checkbox name=FieldLabCheck value=" & objRecordset("FieldLaborSuper") &...
0
by: northshore | last post by:
Hello, I am creating a windows application database. I have a primary table 'Individuals' and a lookup table 'Prefixes.' In the Individuals table, I have a column 'PrefixID' that references...
3
by: technocraze | last post by:
Hi community experts, May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters...
3
by: swinster | last post by:
Hi all, I have not touched access for a very long time and am attempting to help my nephew with his Video Rental Database. This is a simple three-table relationship database comprising a Video...
3
by: doc1355 | last post by:
Hi, I'm new to JavaScript. I'm trying to have a span on my form to sho some detail about the form element when the visitor is entering data. I need this to change based on the drop down menu...
1
by: julianomartins | last post by:
Hi friends, how I make to recoup the value of database and to keep selected in combobox to edit my form? in script below it is selected field of the table that possesss id of the first item of...
2
by: itpvision | last post by:
Hello, I have a link navigation of categories retrieved from the database, while I know how to display subcategories based on category link clicked with classical approach, I want to do this with...
1
Plater
by: Plater | last post by:
I feel like this question has been asked before, but I couldn't find it. I think I am missing something obvious. Basically I am going to have a DataGridView with two columns. One textbox, one...
2
by: sumanta123 | last post by:
Dear Sir, In my develpment i am getting stuck for a senario.Kindly please help me for it. Everytime we give the request we get the response of 8 records and its corresponding value. Then next...
2
David Blackman
by: David Blackman | last post by:
I have a form with 4 unbound listboxes (LB). When the form opens, I want: 1. LB1 to display values in row 1; 2. LB3 to display data based on the value of LB1; 3. LB4 to display data based...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.