We help IT Professionals succeed at work.
Get Started

Recordset filter with $_GET in PHP and Dreamweaver

Last Modified: 2012-05-12
Hello experts.  What I basically have is a page with a dynamic drop-down with company names as the ID as the value (i.e, 1 = companyA, 2=CompanyB, etc.) and trying to pass multiple params to the next page to filter the recordset.  I am using Dreamweaver CS5 for this.

form field 1 (called search3) the dynamic dropdown using values in the DB
form field 2
form field 3
form field 4

Page 1 is the dropdown with a submit button.  It passes the ID value to the next page using a simple recordset and setting the URL parameter equal to the textbox drop-down of "search3".  I have additional textboxes for additional search params on the same page.

Then I am using $_GET['form field 1]' and setting the results page from GET on the search form.  However, I can't get it to work.  Here is my SQL in the Dreamweaver recordset:

SELECT * FROM tblLoad_Master WHERE Company_Name_ID = colname OR Master_Agreement_ID = manum OR Ins_Contact_Add1 = address OR Ins_Contact_State = state

Colname is the name of the first parameter DW came up with and it points to my dynamic recordset [search3].  It seems to filter the Company_Name_ID okay but nothing else.  Suggestions?

Then I added the other parameters with $_GET for the rest of the variables.

And the default is "-1" on the params, integer on the company_id and text on the rest.

I can read code pretty good but not write it.  I have attached my 2 php pages. search-company.php search-filter45.php
Watch Question
Most Valuable Expert 2011
Author of the Year 2014
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE