Dreamweaver forms: Drop down list will not page to show info in database.

I have a form made in dreamweaver with a paging feature to move through records. Everything works as it should except that the drop down field doesn't work. It just shows the same info that is in the drop down list and not what is actually in the table.

I am not able to get it to work like the other fields. I had a server behavior in the drop down field but this didn't seem to help either.

I have attached the file.
farmDepre.php
James CoatsComputer Info. Sys. StudentAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineNo oneCommented:
The select field is dependent on a recordset named rs_busDepre which doesn't appear to be set on the attached PHP page.
0
James CoatsComputer Info. Sys. StudentAuthor Commented:
Looking into this now
0
James CoatsComputer Info. Sys. StudentAuthor Commented:
Don't know why but my DWCS6 is crashing a lot today.

I looked at the select field and I think I see what you point out. The record set rs_busDepre will correctly submit whatever is selected from the drop down menu to the database table. It just doesn't show records submitted when you page through the records in the form.

I don't know how to set the record set rs_busDepre so that it is attached to the page. I am self taught and I have holes in my knowledge base. Do you mean something like an "include" statement or file pointed at the page? Or do I have to define this in the record set itself??
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Jason C. LevineNo oneCommented:
Let's clarify.

The record set rs_busDepre will correctly submit whatever is selected from the drop down menu to the database table.

No.  rs_busDepre sets the options of the select field.  Whatever the user selects is submitted with the rest of the form.

The do { } while() construct in the code below is a loop that runs through the recordset.  With no recordset, there is nothing to loop through, so no options appear

        <select name="farmDepreMeth" title="<?php echo $row_rs_farmDepre['farmDepreMeth']; ?>">
          <?php
do {  
?>
          <option value="<?php echo $row_rs_busDepre['busDepreMeth']?>"><?php echo $row_rs_busDepre['busDepreMeth']?></option>
          <?php
} while ($row_rs_busDepre = mysql_fetch_assoc($rs_busDepre));
  $rows = mysql_num_rows($rs_busDepre);
  if($rows > 0) {
      mysql_data_seek($rs_busDepre, 0);
	  $row_rs_busDepre = mysql_fetch_assoc($rs_busDepre);
  }
?>
      </select>

Open in new window


I don't know how to set the record set rs_busDepre so that it is attached to the page.

Just create the recordset on this page.

holes in my knowledge base.

So I'm a little unclear as to what you want this select field to do.  Are you entering data elsewhere and want that value to be a default for this select field (it shows up with something already selected) or are you entering data elsewhere and those values update the available choices for this select field?
0
James CoatsComputer Info. Sys. StudentAuthor Commented:
The select field to me seems to be doing what it should. It shows the selections that are available and it will submit the one selected to the table where it belongs. Once the data has been submitted I want to be able to page through the records and see the various records that have been submitted.

I can see all the records that have been submitted as you page through them in the form except for the drop down field which continues to show the first selection on the drop down list. This page is actually live and you can visit it here:

http://tax-toolbox.com/Farm/farmDepre.php

Hope this helps.
0
Jason C. LevineNo oneCommented:
Once the data has been submitted I want to be able to page through the records and see the various records that have been submitted.

Then select the dropdown list in Dreamweaver and hit the lightning bolt icon next to default value in the Properties bar. Set the value to match the correct column in the recordset that populates the paging.

Alternately, don't display records in a form format for viewing entries and just echo out the proper column from the proper dataset.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James CoatsComputer Info. Sys. StudentAuthor Commented:
I think I'll use the second suggestion you gave. Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Dreamweaver

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.