• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

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
0
James Coats
Asked:
James Coats
  • 4
  • 3
1 Solution
 
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 CoatsAuthor Commented:
Looking into this now
0
 
James CoatsAuthor 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
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
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 CoatsAuthor 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
 
James CoatsAuthor Commented:
I think I'll use the second suggestion you gave. Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now