Records shown twice and recently even three times

Records shown twice and recently even three times

RappiRappi Posts: 82Questions: 18Answers: 1

Hello.

I have a very big problem for a customer.
Our online solution runs at several customers and all but a also has no problems. This a customer has its data imported and not entered manually. I think this is an error in the data or the database, but it can not locate.

In DataTables many records after editing some records, now shown twice and recently even three times.

In the database, they are, however, only once.
I can detect no error in the database ....

Unfortunately, the debugger is not running well. He tries to save the data and remains available and the browser is timing out.
To see what extensions I use here DebugCode the same table with another database: unoqog

Here times eingie Screeshots because the system is a closed system (user name and password are required).

http://www.rappi.de/download/error1.png
http://www.rappi.de/download/error2.png

Does anyone have any idea where I could see and what remains to be tested?

Best regards

Thomas

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi Thomas,

    What happens if you order the table by id in phpMyAdmin? Also, what is the JSON data returned from the server?

    Allan

  • RappiRappi Posts: 82Questions: 18Answers: 1
    edited February 2016

    Hi Allen.

    When I sorted phpMyAdmin by id, it looks exactly the same. The records are really only once.
    The data coming via Jason, are actually correct, but also twice ....

    The same script is run multiple times with other databases without error. Only in this one database there are problems. So it can not actually lie on the script, except that it does not come with any errors in the data handle.

    But which error?

    Thanks for your support!

    Thomas

    {
        "data": [{
                    "DT_RowId": "row_1",
                    "tm_tiere": {
                        "id": "1",
                        "lfdnr": "29",
                        "Geloescht": "0",
                        "Name": "Bea",
                        "Aufnahmedatum": "2014-01-25",
                        "Aufnahmegrund": "-Direktvermittlung",
                        "Woher": "0",
                        "Tierart": "1",
                        "Rasse": "Mix",
                        "Geburtsdatum": "0000-00-00",
                        "Age": "0",
                        "Geschlecht": "w",
                        "Kastriert": "0",
                        "Laeufig": "0000-00-00",
                        "Farbe": "",
                        "Aufenthaltsort": "5",
                        "Intra": "RO.2014.0003050 - V1",
                        "Tasso": "",
                        "Chip1": "941 0000 1615 4039",
                        "Chiport1": "",
                        "Chip1wann": "0000-00-00",
                        "Chip2": "",
                        "Chiport2": "",
                        "Ringnummer": "",
                        "Stubenrein": "0",
                        "Verhaltensgestoert": "0",
                        "Kinderfreundlich": "0",
                        "Haeuslich": "0",
                        "Angstbeisser": "0",
                        "Vertraeglich": "0",
                        "Letzte_Impfung": "0000-00-00",
                        "Naechste_Impfung": "0000-00-00",
                        "Ausweis": "",
                        "Ausweisnr": "",
                        "Tierarzt": "2",
                        "FiV": "0",
                        "FiVp": "0",
                        "FiP": "0",
                        "FiPp": "0",
                        "FelV": "0",
                        "FelVp": "0",
                        "MMT": "0",
                        "MMTp": "0",
                        "Tollwut": "0",
                        "Tollwutp": "0",
                        "Tollwutdatum": "0000-00-00",
                        "Tgueltigdatum": "0000-00-00",
                        "Naechste_Entwurmung": "0000-00-00",
                        "Entwurmungdatum": "0000-00-00",
                        "Krankheiten": "",
                        "Besonderheiten": "",
                        "Pflegestelle": "124",
                        "Adoptant": "1",
                        "Vermitteltdatum": "2014-01-25",
                        "Pate": "0",
                        "Image": "no-image.jpg",
                        "Verstorben": "0000-00-00",
                        "Schutzgebuehr": "0",
                        "Vertrag": "0",
                        "Ansprechpartner": "",
                        "Telefon": "",
                        "Handy": "",
                        "Email": "",
                        "Uhrzeit": "",
                        "Beschreibung": "",
                        "Homepage": "0"
                    },
                    "tm_tierart": {
                        "Art": "Hund"
                    },
                    "tm_aufenthaltsort": {
                        "Ort": "Deutschland"
                    },
                    "tm_arzt": {
                        "Name": "Dr. Brocker"
                    },
                    "tm_pflegestellen": {
                        "Name": "- Direktvermittlung  -"
                    },
                    "tm_adoptanten": {
                        "Name": "Beger"
                    },
                    "tm_paten": {
                        "Name": null
                    }
                }, {
                    "DT_RowId": "row_1",
                    "tm_tiere": {
                        "id": "1",
                        "lfdnr": "29",
                        "Geloescht": "0",
                        "Name": "Bea",
                        "Aufnahmedatum": "2014-01-25",
                        "Aufnahmegrund": "-Direktvermittlung",
                        "Woher": "0",
                        "Tierart": "1",
                        "Rasse": "Mix",
                        "Geburtsdatum": "0000-00-00",
                        "Age": "0",
                        "Geschlecht": "w",
                        "Kastriert": "0",
                        "Laeufig": "0000-00-00",
                        "Farbe": "",
                        "Aufenthaltsort": "5",
                        "Intra": "RO.2014.0003050 - V1",
                        "Tasso": "",
                        "Chip1": "941 0000 1615 4039",
                        "Chiport1": "",
                        "Chip1wann": "0000-00-00",
                        "Chip2": "",
                        "Chiport2": "",
                        "Ringnummer": "",
                        "Stubenrein": "0",
                        "Verhaltensgestoert": "0",
                        "Kinderfreundlich": "0",
                        "Haeuslich": "0",
                        "Angstbeisser": "0",
                        "Vertraeglich": "0",
                        "Letzte_Impfung": "0000-00-00",
                        "Naechste_Impfung": "0000-00-00",
                        "Ausweis": "",
                        "Ausweisnr": "",
                        "Tierarzt": "2",
                        "FiV": "0",
                        "FiVp": "0",
                        "FiP": "0",
                        "FiPp": "0",
                        "FelV": "0",
                        "FelVp": "0",
                        "MMT": "0",
                        "MMTp": "0",
                        "Tollwut": "0",
                        "Tollwutp": "0",
                        "Tollwutdatum": "0000-00-00",
                        "Tgueltigdatum": "0000-00-00",
                        "Naechste_Entwurmung": "0000-00-00",
                        "Entwurmungdatum": "0000-00-00",
                        "Krankheiten": "",
                        "Besonderheiten": "",
                        "Pflegestelle": "124",
                        "Adoptant": "1",
                        "Vermitteltdatum": "2014-01-25",
                        "Pate": "0",
                        "Image": "no-image.jpg",
                        "Verstorben": "0000-00-00",
                        "Schutzgebuehr": "0",
                        "Vertrag": "0",
                        "Ansprechpartner": "",
                        "Telefon": "",
                        "Handy": "",
                        "Email": "",
                        "Uhrzeit": "",
                        "Beschreibung": "",
                        "Homepage": "0"
                    },
                    "tm_tierart": {
                        "Art": "Hund"
                    },
                    "tm_aufenthaltsort": {
                        "Ort": "Deutschland"
                    },
                    "tm_arzt": {
                        "Name": "Dr. Brocker"
                    },
                    "tm_pflegestellen": {
                        "Name": "- Direktvermittlung  -"
                    },
                    "tm_adoptanten": {
                        "Name": "Beger"
                    },
                    "tm_paten": {
                        "Name": null
                    }
                }, {
                    "DT_RowId": "row_1",
                    "tm_tiere": {
                        "id": "1",
                        "lfdnr": "29",
                        "Geloescht": "0",
                        "Name": "Bea",
                        "Aufnahmedatum": "2014-01-25",
                        "Aufnahm
    

    Edited by Allan - code formatting and highlighting

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    If you were to write a trivial little PHP script which does a SELECT * from that table and then shows the results - does it show duplicates?

    What code are you using to get the data at the moment?

    Allan

  • RappiRappi Posts: 82Questions: 18Answers: 1

    Hi again.

    If I make a simple select * statement, then the display is correct. Each data set is only available once and the total of rows is correct too.

    This code I am using:

    <?php
    require_once("models/config.php"); 
    
    /*
     * Editor server script for DB table tiere
     * Created by http://editor.datatables.net/generator
     */
    
    // DataTables PHP library and database connection
    include( "classes/DataTables.php" );
    
    $db->sql("SET character_set_client=utf8");
    $db->sql("SET character_set_connection=utf8");
    $db->sql("SET character_set_results=utf8");
    
    
    // Alias Editor classes so they are easy to use
    use
        DataTables\Editor,
        DataTables\Editor\Field,
        DataTables\Editor\Format,
        DataTables\Editor\Join,
        DataTables\Editor\Validate;
    
    
    // Build our Editor instance and process the data coming from _POST
    Editor::inst( $db, 'tm_tiere', 'id' )
        ->fields(
            Field::inst( 'tm_tiere.id' ),
            Field::inst( 'tm_tiere.lfdnr' ),
            Field::inst( 'tm_tiere.Geloescht' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Name' )
                ->validator( 'Validate::notEmpty' ),
            Field::inst( 'tm_tiere.Aufnahmedatum' ),
            Field::inst( 'tm_tiere.Aufnahmegrund' ),
            Field::inst( 'tm_tiere.Woher' ),
            Field::inst( 'tm_tiere.Tierart' )
                ->options( 'tm_tierart', 'id', 'Art' ),
            Field::inst( 'tm_tierart.Art' ),
            Field::inst( 'tm_tiere.Rasse' ),
            Field::inst( 'tm_tiere.Geburtsdatum' ),
            Field::inst( 'tm_tiere.Age' ),
            Field::inst( 'tm_tiere.Geschlecht' ),
            Field::inst( 'tm_tiere.Kastriert' ),
            Field::inst( 'tm_tiere.Laeufig' ),
            Field::inst( 'tm_tiere.Farbe' ),
            Field::inst( 'tm_tiere.Aufenthaltsort' )
                ->options( 'tm_aufenthaltsort', 'id', 'Ort' ),
            Field::inst( 'tm_aufenthaltsort.Ort' ),
            Field::inst( 'tm_tiere.Intra' ),
            Field::inst( 'tm_tiere.Tasso' ),
            Field::inst( 'tm_tiere.Chip1' ),
            Field::inst( 'tm_tiere.Chiport1' ),
            Field::inst( 'tm_tiere.Chip1wann' ),
            Field::inst( 'tm_tiere.Chip2' ),
            Field::inst( 'tm_tiere.Chiport2' ),
            Field::inst( 'tm_tiere.Ringnummer' ),
            Field::inst( 'tm_tiere.Stubenrein' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Verhaltensgestoert' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Kinderfreundlich' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Haeuslich' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Angstbeisser' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Vertraeglich' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Letzte_Impfung' ),
            Field::inst( 'tm_tiere.Naechste_Impfung' ),
            Field::inst( 'tm_tiere.Ausweis' ),
            Field::inst( 'tm_tiere.Ausweisnr' ),
            Field::inst( 'tm_tiere.Tierarzt' )
                ->options( 'tm_arzt', 'id', 'Name' ),
            Field::inst( 'tm_arzt.Name' ),
            Field::inst( 'tm_tiere.FiV' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.FiVp' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.FiP' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.FiPp' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.FelV' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.FelVp' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.MMT' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.MMTp' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Tollwut' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Tollwutp' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Tollwutdatum' ),
            Field::inst( 'tm_tiere.Tgueltigdatum' ),
            Field::inst( 'tm_tiere.Naechste_Entwurmung' ),
            Field::inst( 'tm_tiere.Entwurmungdatum' ),
            Field::inst( 'tm_tiere.Krankheiten' ),
            Field::inst( 'tm_tiere.Besonderheiten' ),
            Field::inst( 'tm_tiere.Pflegestelle' )
                ->options( 'tm_pflegestellen', 'id', 'Name' ),
            Field::inst( 'tm_pflegestellen.Name' ),
            Field::inst( 'tm_tiere.Adoptant' )
                ->options( 'tm_adoptanten', 'id', 'Name' ),
            Field::inst( 'tm_adoptanten.Name' ),
            Field::inst( 'tm_tiere.Vermitteltdatum' ),
            Field::inst( 'tm_tiere.Pate' )
                ->options( 'tm_paten', 'id', 'Name' ),
            Field::inst( 'tm_paten.Name' ),
            Field::inst( 'tm_tiere.Image' ),
            Field::inst( 'tm_tiere.Verstorben' ),
            Field::inst( 'tm_tiere.Schutzgebuehr' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Vertrag' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } ),
            Field::inst( 'tm_tiere.Ansprechpartner' ),
            Field::inst( 'tm_tiere.Telefon' ),
            Field::inst( 'tm_tiere.Handy' ),    
            Field::inst( 'tm_tiere.Email' ),
            Field::inst( 'tm_tiere.Uhrzeit' ),
            Field::inst( 'tm_tiere.Beschreibung' ),
            Field::inst( 'tm_tiere.Homepage' )
            ->setFormatter( function ( $val, $data, $opts ) {
                    return ! $val ? 0 : 1;
                } )
        )
        
        ->where( 'tm_tiere.Geloescht', 0, '=')
        
         ->leftJoin( 'tm_tierart', 'tm_tierart.id', '=' , 'tm_tiere.Tierart' )
         ->leftJoin( 'tm_aufenthaltsort', 'tm_aufenthaltsort.id', '=' , 'tm_tiere.Aufenthaltsort' )
         ->leftJoin( 'tm_pflegestellen', 'tm_pflegestellen.id', '=' , 'tm_tiere.Pflegestelle' )
         ->leftJoin( 'tm_adoptanten', 'tm_adoptanten.id', '=' , 'tm_tiere.Adoptant' )
          ->leftJoin( 'tm_paten', 'tm_paten.id', '=' , 'tm_tiere.Pate' )
          ->leftJoin( 'tm_arzt', 'tm_arzt.id', '=' , 'tm_tiere.Tierarzt' )
        ->process( $_POST )
        ->json();
    

    Thomas

  • RappiRappi Posts: 82Questions: 18Answers: 1

    My JS is too long to post here (the editor say....).

    You can find it here http://www.rappi.de/download/tiere.js.txt

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Thanks! Next step - let's see what SQL Editor is actually creating.

    In the Database/Drivers/Mysql/Query.php file (assuming you are using MySQL, similar for the others) you'll find a commented out file_put_contents function call. Comment that back in and update the path as you need. Then reload the page and the SQL executed will be dumped into that file. What is the query shown?

    Allan

  • RappiRappi Posts: 82Questions: 18Answers: 1
    edited February 2016

    Here is the result:

    SET character_set_client=utf8
    SET character_set_connection=utf8
    SET character_set_results=utf8
    SELECT  tm_tiere.id as 'tm_tiere.id', tm_tiere.id as 'tm_tiere.id', tm_tiere.lfdnr as 'tm_tiere.lfdnr', tm_tiere.Geloescht as 'tm_tiere.Geloescht', tm_tiere.Name as 'tm_tiere.Name', tm_tiere.Aufnahmedatum as 'tm_tiere.Aufnahmedatum', tm_tiere.Aufnahmegrund as 'tm_tiere.Aufnahmegrund', tm_tiere.Woher as 'tm_tiere.Woher', tm_tiere.Tierart as 'tm_tiere.Tierart', tm_tierart.Art as 'tm_tierart.Art', tm_tiere.Rasse as 'tm_tiere.Rasse', tm_tiere.Geburtsdatum as 'tm_tiere.Geburtsdatum', tm_tiere.Age as 'tm_tiere.Age', tm_tiere.Geschlecht as 'tm_tiere.Geschlecht', tm_tiere.Kastriert as 'tm_tiere.Kastriert', tm_tiere.Laeufig as 'tm_tiere.Laeufig', tm_tiere.Farbe as 'tm_tiere.Farbe', tm_tiere.Aufenthaltsort as 'tm_tiere.Aufenthaltsort', tm_aufenthaltsort.Ort as 'tm_aufenthaltsort.Ort', tm_tiere.Intra as 'tm_tiere.Intra', tm_tiere.Tasso as 'tm_tiere.Tasso', tm_tiere.Chip1 as 'tm_tiere.Chip1', tm_tiere.Chiport1 as 'tm_tiere.Chiport1', tm_tiere.Chip1wann as 'tm_tiere.Chip1wann', tm_tiere.Chip2 as 'tm_tiere.Chip2', tm_tiere.Chiport2 as 'tm_tiere.Chiport2', tm_tiere.Ringnummer as 'tm_tiere.Ringnummer', tm_tiere.Stubenrein as 'tm_tiere.Stubenrein', tm_tiere.Verhaltensgestoert as 'tm_tiere.Verhaltensgestoert', tm_tiere.Kinderfreundlich as 'tm_tiere.Kinderfreundlich', tm_tiere.Haeuslich as 'tm_tiere.Haeuslich', tm_tiere.Angstbeisser as 'tm_tiere.Angstbeisser', tm_tiere.Vertraeglich as 'tm_tiere.Vertraeglich', tm_tiere.Letzte_Impfung as 'tm_tiere.Letzte_Impfung', tm_tiere.Naechste_Impfung as 'tm_tiere.Naechste_Impfung', tm_tiere.Ausweis as 'tm_tiere.Ausweis', tm_tiere.Ausweisnr as 'tm_tiere.Ausweisnr', tm_tiere.Tierarzt as 'tm_tiere.Tierarzt', tm_arzt.Name as 'tm_arzt.Name', tm_tiere.FiV as 'tm_tiere.FiV', tm_tiere.FiVp as 'tm_tiere.FiVp', tm_tiere.FiP as 'tm_tiere.FiP', tm_tiere.FiPp as 'tm_tiere.FiPp', tm_tiere.FelV as 'tm_tiere.FelV', tm_tiere.FelVp as 'tm_tiere.FelVp', tm_tiere.MMT as 'tm_tiere.MMT', tm_tiere.MMTp as 'tm_tiere.MMTp', tm_tiere.Tollwut as 'tm_tiere.Tollwut', tm_tiere.Tollwutp as 'tm_tiere.Tollwutp', tm_tiere.Tollwutdatum as 'tm_tiere.Tollwutdatum', tm_tiere.Tgueltigdatum as 'tm_tiere.Tgueltigdatum', tm_tiere.Naechste_Entwurmung as 'tm_tiere.Naechste_Entwurmung', tm_tiere.Entwurmungdatum as 'tm_tiere.Entwurmungdatum', tm_tiere.Krankheiten as 'tm_tiere.Krankheiten', tm_tiere.Besonderheiten as 'tm_tiere.Besonderheiten', tm_tiere.Pflegestelle as 'tm_tiere.Pflegestelle', tm_pflegestellen.Name as 'tm_pflegestellen.Name', tm_tiere.Adoptant as 'tm_tiere.Adoptant', tm_adoptanten.Name as 'tm_adoptanten.Name', tm_tiere.Vermitteltdatum as 'tm_tiere.Vermitteltdatum', tm_tiere.Pate as 'tm_tiere.Pate', tm_paten.Name as 'tm_paten.Name', tm_tiere.Image as 'tm_tiere.Image', tm_tiere.Verstorben as 'tm_tiere.Verstorben', tm_tiere.Schutzgebuehr as 'tm_tiere.Schutzgebuehr', tm_tiere.Vertrag as 'tm_tiere.Vertrag', tm_tiere.Ansprechpartner as 'tm_tiere.Ansprechpartner', tm_tiere.Telefon as 'tm_tiere.Telefon', tm_tiere.Handy as 'tm_tiere.Handy', tm_tiere.Email as 'tm_tiere.Email', tm_tiere.Uhrzeit as 'tm_tiere.Uhrzeit', tm_tiere.Beschreibung as 'tm_tiere.Beschreibung', tm_tiere.Homepage as 'tm_tiere.Homepage' FROM  tm_tiere LEFT JOIN tm_tierart ON tm_tierart.id = tm_tiere.Tierart  LEFT JOIN tm_aufenthaltsort ON tm_aufenthaltsort.id = tm_tiere.Aufenthaltsort  LEFT JOIN tm_pflegestellen ON tm_pflegestellen.id = tm_tiere.Pflegestelle  LEFT JOIN tm_adoptanten ON tm_adoptanten.id = tm_tiere.Adoptant  LEFT JOIN tm_paten ON tm_paten.id = tm_tiere.Pate  LEFT JOIN tm_arzt ON tm_arzt.id = tm_tiere.Tierarzt WHERE tm_tiere.Geloescht = :where_0 
    SELECT DISTINCT  id as value, Art as label FROM  tm_tierart  ORDER BY label  asc 
    SELECT DISTINCT  id as value, Ort as label FROM  tm_aufenthaltsort  ORDER BY label  asc 
    SELECT DISTINCT  id as value, Name as label FROM  tm_arzt  ORDER BY label  asc 
    SELECT DISTINCT  id as value, Name as label FROM  tm_pflegestellen  ORDER BY label  asc 
    SELECT DISTINCT  id as value, Name as label FROM  tm_adoptanten  ORDER BY label  asc 
    SELECT DISTINCT  id as value, Name as label FROM  tm_paten  ORDER BY label  asc 
    
    
  • RappiRappi Posts: 82Questions: 18Answers: 1

    The <code> is a `.

    I don't know why your editor here in the forum overright many, but not all, `....

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    I don't know why your editor here in the forum overright many, but not all, `....

    Me either - I really need to get around to looking into that... I've removed them for now.

    And if you run that query in phpMyAdmin (or whatever), do you get the duplicates? I've reformatted the query in question below:

    SELECT  tm_tiere.id as 'tm_tiere.id',
        tm_tiere.id as 'tm_tiere.id',
        tm_tiere.lfdnr as 'tm_tiere.lfdnr',
        tm_tiere.Geloescht as 'tm_tiere.Geloescht',
        tm_tiere.Name as 'tm_tiere.Name',
        tm_tiere.Aufnahmedatum as 'tm_tiere.Aufnahmedatum',
        tm_tiere.Aufnahmegrund as 'tm_tiere.Aufnahmegrund',
        tm_tiere.Woher as 'tm_tiere.Woher',
        tm_tiere.Tierart as 'tm_tiere.Tierart',
        tm_tierart.Art as 'tm_tierart.Art',
        tm_tiere.Rasse as 'tm_tiere.Rasse',
        tm_tiere.Geburtsdatum as 'tm_tiere.Geburtsdatum',
        tm_tiere.Age as 'tm_tiere.Age',
        tm_tiere.Geschlecht as 'tm_tiere.Geschlecht',
        tm_tiere.Kastriert as 'tm_tiere.Kastriert',
        tm_tiere.Laeufig as 'tm_tiere.Laeufig',
        tm_tiere.Farbe as 'tm_tiere.Farbe',
        tm_tiere.Aufenthaltsort as 'tm_tiere.Aufenthaltsort',
        tm_aufenthaltsort.Ort as 'tm_aufenthaltsort.Ort',
        tm_tiere.Intra as 'tm_tiere.Intra',
        tm_tiere.Tasso as 'tm_tiere.Tasso',
        tm_tiere.Chip1 as 'tm_tiere.Chip1',
        tm_tiere.Chiport1 as 'tm_tiere.Chiport1',
        tm_tiere.Chip1wann as 'tm_tiere.Chip1wann',
        tm_tiere.Chip2 as 'tm_tiere.Chip2',
        tm_tiere.Chiport2 as 'tm_tiere.Chiport2',
        tm_tiere.Ringnummer as 'tm_tiere.Ringnummer',
        tm_tiere.Stubenrein as 'tm_tiere.Stubenrein',
        tm_tiere.Verhaltensgestoert as 'tm_tiere.Verhaltensgestoert',
        tm_tiere.Kinderfreundlich as 'tm_tiere.Kinderfreundlich',
        tm_tiere.Haeuslich as 'tm_tiere.Haeuslich',
        tm_tiere.Angstbeisser as 'tm_tiere.Angstbeisser',
        tm_tiere.Vertraeglich as 'tm_tiere.Vertraeglich',
        tm_tiere.Letzte_Impfung as 'tm_tiere.Letzte_Impfung',
        tm_tiere.Naechste_Impfung as 'tm_tiere.Naechste_Impfung',
        tm_tiere.Ausweis as 'tm_tiere.Ausweis',
        tm_tiere.Ausweisnr as 'tm_tiere.Ausweisnr',
        tm_tiere.Tierarzt as 'tm_tiere.Tierarzt',
        tm_arzt.Name as 'tm_arzt.Name',
        tm_tiere.FiV as 'tm_tiere.FiV',
        tm_tiere.FiVp as 'tm_tiere.FiVp',
        tm_tiere.FiP as 'tm_tiere.FiP',
        tm_tiere.FiPp as 'tm_tiere.FiPp',
        tm_tiere.FelV as 'tm_tiere.FelV',
        tm_tiere.FelVp as 'tm_tiere.FelVp',
        tm_tiere.MMT as 'tm_tiere.MMT',
        tm_tiere.MMTp as 'tm_tiere.MMTp',
        tm_tiere.Tollwut as 'tm_tiere.Tollwut',
        tm_tiere.Tollwutp as 'tm_tiere.Tollwutp',
        tm_tiere.Tollwutdatum as 'tm_tiere.Tollwutdatum',
        tm_tiere.Tgueltigdatum as 'tm_tiere.Tgueltigdatum',
        tm_tiere.Naechste_Entwurmung as 'tm_tiere.Naechste_Entwurmung',
        tm_tiere.Entwurmungdatum as 'tm_tiere.Entwurmungdatum',
        tm_tiere.Krankheiten as 'tm_tiere.Krankheiten',
        tm_tiere.Besonderheiten as 'tm_tiere.Besonderheiten',
        tm_tiere.Pflegestelle as 'tm_tiere.Pflegestelle',
        tm_pflegestellen.Name as 'tm_pflegestellen.Name',
        tm_tiere.Adoptant as 'tm_tiere.Adoptant',
        tm_adoptanten.Name as 'tm_adoptanten.Name',
        tm_tiere.Vermitteltdatum as 'tm_tiere.Vermitteltdatum',
        tm_tiere.Pate as 'tm_tiere.Pate',
        tm_paten.Name as 'tm_paten.Name',
        tm_tiere.Image as 'tm_tiere.Image',
        tm_tiere.Verstorben as 'tm_tiere.Verstorben',
        tm_tiere.Schutzgebuehr as 'tm_tiere.Schutzgebuehr',
        tm_tiere.Vertrag as 'tm_tiere.Vertrag',
        tm_tiere.Ansprechpartner as 'tm_tiere.Ansprechpartner',
        tm_tiere.Telefon as 'tm_tiere.Telefon',
        tm_tiere.Handy as 'tm_tiere.Handy',
        tm_tiere.Email as 'tm_tiere.Email',
        tm_tiere.Uhrzeit as 'tm_tiere.Uhrzeit',
        tm_tiere.Beschreibung as 'tm_tiere.Beschreibung',
        tm_tiere.Homepage as 'tm_tiere.Homepage'
    FROM  tm_tiere
    LEFT JOIN tm_tierart ON tm_tierart.id = tm_tiere.Tierart
    LEFT JOIN tm_aufenthaltsort ON tm_aufenthaltsort.id = tm_tiere.Aufenthaltsort
    LEFT JOIN tm_pflegestellen ON tm_pflegestellen.id = tm_tiere.Pflegestelle
    LEFT JOIN tm_adoptanten ON tm_adoptanten.id = tm_tiere.Adoptant
    LEFT JOIN tm_paten ON tm_paten.id = tm_tiere.Pate
    LEFT JOIN tm_arzt ON tm_arzt.id = tm_tiere.Tierarzt
    WHERE tm_tiere.Geloescht = 0
    

    Allan

  • RappiRappi Posts: 82Questions: 18Answers: 1

    Yes!

    In phpMyAdmin are the same duplicates now.

  • RappiRappi Posts: 82Questions: 18Answers: 1

    I found the mistake!
    In the table tm tiere.Aufenthaltsort no primary key was set and it has duplicate entrys.

    Many, many thanks for your help!
    You are the best!

    Best regards
    Thomas

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi Thomas,

    Awesome - great to hear you got it sorted out!

    Regards,
    Allan

This discussion has been closed.