Oakster Posted August 28, 2024 Report Share Posted August 28, 2024 I have a custom page that I would like to show a list of all the criminal ancestors I have. It will have some explanatory text and then the list of those people that can be clicked on to go to their profile. I have created a report that lists people who have a criminal event, some people have more than one of the event. How do I produce a list that oesn't show the same person more than once, irrelevant of how many of the event they have? I would then like to add the report outcome to a page, rather than just linking to the report it itself. This is how it looked on an old site I had and is what I am trying to reproduce: https://freepages.rootsweb.com/~oakleyfamilytree/genealogy/criminal.htm Quote Link to comment Share on other sites More sharing options...
ADC Posted August 28, 2024 Report Share Posted August 28, 2024 The trick is to use the DISTINCT qualifier, for example: SELECT DISTINCT column1, column2, ... FROM table_name; If you post the SQL code you are using I can probably help more. To include it in a page you will probably need to add some PHP code to run the sql query, it is normally quite straightforward and there are plenty of examples in existing TNG pages, in fact each page probably has multiple examples as it is database-driven. Again, I might be able to help more once you have written the page you want to add the query to (you could start by copying the page you have linked to). Quote Link to comment Share on other sites More sharing options...
Oakster Posted August 28, 2024 Author Report Share Posted August 28, 2024 The report I created is just in the reports section at the moment. The sql code is: SQL: SELECT tng_people.living, tng_people.private, lnprefix, prefix, suffix, title, tng_people.branch, birthdate, birthdatetr, altbirthdate, altbirthdatetr, deathdate, deathdatetr,lastname, firstname,birthdate,deathdate,e110.eventdate as eventdate110, tng_people.personID, tng_people.gedcom, nameorder FROM (tng_people ) LEFT JOIN tng_events e110 ON tng_people.personID = e110.persfamID AND tng_people.gedcom = e110.gedcom AND e110.eventtypeID = "110" WHERE (e110.eventdate != "") AND tng_people.gedcom = "OakGen1" ORDER BY lastname,firstname The very basic page I want it to go on is here: https://oakleygenealogy.co.uk/histories/criminalhistory.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.