Hi racmail2001 -
I just plugged that code in and the drop down is not displaying anything. I will look at more closely this morning.
Thanks!
Main Topics
Browse All TopicsI can't believe I'm having so much trouble with this but I'm here in defeat and looking for mercy. I set up a Master Detail Page Set in Dreamweaver CS3 and had it create a Detail Page for me like it does so well. What I've done in the past (and this time) is used the Update Record Form Wizard to create an update page on the detail page. I find this works well because I can "call" the DetailRS1 recordset to populate the fields and then when I click on a record in the master detail page it takes me to the detail page with the update form. I usually end up deleting the detail form because it is redundant and I deleted it in this case as well.
Now I have a detail/update page that is displaying and updating all of the fields properly expect for four menu/list drop downs that for the life of me I can't get to display the correct values initially (the values that are currently stored in the database). It's driving me bananas. I have other form fields, even radio groups that are populating perfectly fine. Below is the code to one of the menu drop downs. It contains a list of years for car makes. I have a couple of recordsets that I'm pulling data from but all I want is to have the correct year initially selected in the drop down. I don't care how it gets there. Thanks in advance for your help.
If you need more info let me know. The code on this page is very lengthy so I think I should refrain from posting it all.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Back again, thought it was working but it isn't. Now, some fields are updating and not others. Any ideas why all of the plain text box fields always populate correctly but the drop downs don't always pull the correct data. I thought it might have something to do with session variables but I played with that and it doesn't appear to be the case. How much code would you like to see?
In the detail page, you are attempting to set session variables if a post variable exist. But the master page is not posting to the detail...just linking. Not sure if it's an issue, but you should probably remove it if it isn't supposed to be there.
>> Any ideas why all of the plain text box fields always populate correctly but the drop downs don't
>> always pull the correct data.
It could be related to this:
<option value="<?php echo $row_Recordset4['makes']?>"
You are attempting to match text with HTML entities and UTF-8 encoding and that could cause the failure to associate the stored value with the list value.
Are you storing formatted text in the database?
>> Now, it appears that two of the radio button groups are not pulling from the database as expected.
Same deal:
<input type="radio" name="followUpLetter" value="Yes <?php if (!(strcmp(htmlentities($ro
Jason -
When a user clicks on the update button on the detail page, they're taken to the next page where those session variables are used. I think I need to keep them in there.
Dreammweaver helped me create this monster :) :
<option value="<?php echo $row_Recordset4['makes']?>"
I don't have formatted text in my database. If I can use something other than htmlentities and UTF-8 in this string please tell me what you think might work.
Thanks :)
Brent
>> they're taken to the next page where those session variables are used. I think I need to keep them in
>> there.
No, all you would need is:
if (!session_id()) session_start();
Once the session variables are assigned, all you need is the above code to have them available to that page. You don't need to reset them each time. Besides, your current code on the detail page is looking for a post action. It will never evaluate so you are wasting bytes.
>> Dreammweaver helped me create this monster :) :
It may be because you are using UTF-8 encoding on the pages (which isn't strictly needed). The calls should look more like this:
<option value="<?php echo $row_Recordset4['makes']?>"
In other words, just remove
, ENT_COMPAT, 'UTF-8'
from the above and see if it works better. If you still don't have agreement between the detail recordset and options, you need to double check to see if the values are being pulled properly. I would also consider removing the UTF-8 line:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
and rebuilding the dynamic lists.
>> Dreamweaver defaults to DetailRS1 but is that the best recordset to be using?
You need to use whatever recordset contains the detail row. So long as the data is coming into the regular input boxes correctly, the DetailRS1 is fine. The problem seems to be with creating the correct lookup tables for the other fields.
>> Should I create another recordset and include all of the fields in my database and try pulling from there?
See above. You should not have to do this.
>> Also what's the difference between using double quotation marks " " and single quotation marks ' '?
In HTML? None. In PHP, variables inside of a double-quote will be evaluated. So:
<?php echo "$somevar" ?>
Should produce whatever is stored in $somevar
<?php echo '$somevar' ?>
will produce the text $somevar
Upon further inspection it appears my database is using the following: MySQL charset: UTF-8 Unicode (utf8)
Also, the MySQL connection collation is set to utf8_unicode_ci
I'm using PHP 5.
It doesn't appear I can remove/change the UTF-8 Unicode character set only change the collation. Should the collation be set to something different?
The question about the " " and ' ' arose from the fact that I have this string for a text box:
<input type="text" name="newPayment" value="<?php echo htmlentities($row_DetailRS
and this for the radio group:
<input type="radio" name="followUpLetter" value="Yes" <?php if (!(strcmp(htmlentities($ro
>> For the text box ['newPayment'] is in single quotes and in the radio group ["followUpLetter"] is in double quotes.
It's fine. The reason for this is the text box has external double quotes from the value="" so the inner quotes are changed to single to avoid a problem with closing the quotes too soon.
value="<?php echo htmlentities($row_DetailRS
The radio has no external quotes, so double works there:
<input type="radio" name="followUpLetter" value="Yes" <?php if (!(strcmp(htmlentities($ro
Jason (and all) -
OK, I'm still having issues and am about to re-do both the master page and detail page. I'm also going to re-create the database. Should my database be encoded with Latin1? I have a choice but it defaults to UTF-8. Also, when setting up my page initially, is there anything that comes to mind that I should ensure are present that I may not have had before?
>> Should my database be encoded with Latin1?
Unless you are going to support foreign alphabets, encode in Latin1
>> Also, when setting up my page initially, is there anything that comes to mind that I should ensure are present
>> that I may not have had before?
Go slow. Build the master page, add the recordset there, then build the detail page with the detail recordset without any of the other recordsets or dynamic form elements. Make sure each thing is working before adding the next thing.
Thanks Jason -
I think my final dilema is how to to have two buttons on the update page, one button that takes you back to the master page users came from and one page that takes you to another page in the site. However, when a user clicks either of the buttons any info on the page that was change needs to be updated in the database. Any ideas how I could do this?
Business Accounts
Answer for Membership
by: racmail2001Posted on 2009-07-31 at 03:31:12ID: 24987540
try to replace your code with this
Select allOpen in new window