Can someone please take a look at my Query and tell me what I am doing wrong? The query works but when I display the results it gives me repeating records. I have attached a complete copy of my script.
$sql = " SELECT s.site_id, s.sitename, s.address1, s.address2, s.city, s.state, s.postal_code, s.site_status, s.description, s.contacts, s.notes,c.record_id, c.ckt_id, b.backup_id, b.isdn_id
FROM site s, site_circuit c, backup b
WHERE s.site_id = \"$site_id\"
AND b.sitename = s.sitename
AND s.sitename = b.sitename";
TABLE: site
FIELDS: site_id, sitename, address1, address2, city, state, postal_code, site_status, description, contacts,notes
TABLE: Site_Circuit
FIELD: record_id, ckt_id, sitename, loopback, router_type, router_name, carrier_id, corebox, coreport, ip_address, ckt_type
local_loop, remote_loop
TABLE: backup
FIELD: backup_id, sitename, solution, carrier_id, router_name, isdn_id, isdn_spids
TABLE: troublelog_test
FIELD: ticket_id, ckt_id, date, last_update, ticket_number, problem, status, initials, action
RELATIONSHIPS: a single site can have one or multiple site_circuits and backups. a single site_circuit and backup can belong to only one site. a site_circuit and backup can have one or multiple troublelog_test but one troublelog_test can only belong to one site_circuit or backup.......hope this makes sense.