Records shown twice and recently even three times
Records shown twice and recently even three times
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
Hi Thomas,
What happens if you order the table by
id
in phpMyAdmin? Also, what is the JSON data returned from the server?Allan
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
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
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:
Thomas
My JS is too long to post here (the editor say....).
You can find it here http://www.rappi.de/download/tiere.js.txt
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 outfile_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
Here is the result:
The <code> is a `.
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:
Allan
Yes!
In phpMyAdmin are the same duplicates now.
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
Hi Thomas,
Awesome - great to hear you got it sorted out!
Regards,
Allan