473,469 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

drop down blank?

1 New Member
Hi I am new to PHP and I have a little problem

I have created a user registration form and on this form I have three drop downs one for title, prov/state and country. This creates a record in the database but when I create an edit user profile page and display the record I have a problem the record displaying correctly and I have tested the output but I cannot get the dropdowns to display the variable from the database



<select name="title" size="1" id="label">
<option selected="selected" value="Mr"><?php if (isset($_POST['title'])) {echo $_POST['title'];} else {echo "Mr";} ?></option>
<option value="Mrs">Mrs</option>
<option value="Ms">Ms</option>
<option value="Dr">Dr</option>
</select>

And I have the record being read from the database but the dropdown are always blank! I have tried to put the variable in the selected value but then when I submit the form it fails saying the field is empty (even though it is in the field)

My question is how can I display the record from mysql in drop downs and have it work when I submit the form after user has edited that field

Thank you
Jan 6 '07 #1
1 1351
ronverdonk
4,258 Recognized Expert Specialist
Your code snippet does not show uw how you get your data from the database, nor does it show anything that looks like populating it with db values.
Please show all the code that gets the data from the db. (enclose code within php, code or html tags!!)

Ronald :cool:
Jan 6 '07 #2

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

Similar topics

2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
10
by: Haines Brown | last post by:
I've implemented the horizontal drop down menu discussed recently in this newsgroup, and it works nicely under Galeon and Mozilla, but not IE 5.0. Here are the problems: Under IE 5.0, the...
1
by: Paul M | last post by:
Hi folks, When I set the datasource of a dropdown list and bind it, the drop down list always defaults to the first item in the list. I need it to default to Nothing or NULL or whatever it is...
3
by: Wayne Dyer | last post by:
I can duplicate this, so I know it's not something I'm imagining and wonder if anyone else has seen it. Take a page, put a drop down control on it, hook up the onChange event handler to go get...
1
by: Big E | last post by:
I'm using ASP.Net and SQL Server. I have a drop down list that populates from a table. When the form opens the drop down list is full of data. I would like the drop down list to not show a default...
0
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
1
by: Basket61 | last post by:
I need to use a drop down box based on table Color that, once you click on a value, populates the field in my form In the main database design, I reference the Table Color, both the ID and the...
2
by: ajaymohank | last post by:
Hello friends.......... i have 3 dropdown in my project, in which 3 of them are linked with each other. ie.... i select a value from the 1st drop down and based on that value, the corresponding...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.