Jump to content
TNG Community

Removing duplicate ID's from a report and how to add the report to a page


Oakster

Recommended Posts

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...