-1

I have, thanks to some help, got the LEFT JOIN working but need it to show selected results based on whether the record is active or not. These are either marked Y or N in the records.

The code is

SELECT suppliers.ID, suppliers.Suppliername, suppliers.postcode, suppliers.address, 
    suppliers.phone, suppliers.fax, suppliers.email, suppliers.website, suppliers.imagename, 
    suppliers.Active, suppliers.RepID, repdetails.RepID, 
    repdetails.RepName, repdetails.RepEmail, repdetails.RepPhone 
FROM suppliers LEFT JOIN repdetails 
    ON suppliers.RepID = repdetails.RepID 
ORDER BY Suppliername ASC

It used to work by using the URL ?Active=Y or ?Active=N but I cannot fathom how to get this working again.

Any help would be appreciated as I'm a newbie :)

Dhruv Saxena
  • 1,336
  • 2
  • 12
  • 29

1 Answers1

1
SELECT suppliers.ID, suppliers.Suppliername, suppliers.postcode, suppliers.address, 
    suppliers.phone, suppliers.fax, suppliers.email, suppliers.website, suppliers.imagename, 
    suppliers.Active, suppliers.RepID, repdetails.RepID, 
    repdetails.RepName, repdetails.RepEmail, repdetails.RepPhone 
FROM suppliers LEFT JOIN repdetails 
    ON suppliers.RepID = repdetails.RepID 
WHERE suppliers.Active = "y" ORDER BY suppliers.Suppliername ASC

Try this

Ümit Aparı
  • 540
  • 2
  • 6
  • 23