PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
What data type is your item_id field? Since the output of MD5() is a string, I'm not sure what happens if you try to store it in a numeric field. I would expect you would get a data type mismatch error.
No, I'm storing the actual md5 string in the guid field... the numbers you see there are from the query above it that ("I think") represents duplicate entries for the field guid...
So is it possible that the other GUIDs were created at an earlier time, say when your code wasnt working properly? The high numbers of duplicates make it very suspicious.
I'm not so sure that your query is showing what you think it is. You said that your table has a numeric `item_id` field and a varchar `guid` field, but in your query, you alias the count as `guid`:
califdon wrote:I'm not so sure that your query is showing what you think it is. You said that your table has a numeric `item_id` field and a varchar `guid` field, but in your query, you alias the count as `guid`:
SELECT count(*) AS CountIDs, guid
FROM clicks
GROUP BY guid
HAVING CountIDs > 1
and see what you get.
This returned one result - 421
Uhhh, what? That SQL asks to return two columns, CountIDs and guid. How could it return "421"?
[That reminds me of the Hitchhiker's Guide to the Galaxy, where Douglas Adams told the story of a race of hyper-intelligent pan-dimensional beings who built a computer named Deep Thought to calculate the Answer to the Ultimate Question of Life, the Universe, and Everything. When the answer was revealed as 42, Deep Thought predicts that another computer, more powerful than itself would be made and designed by it to calculate the question for the answer. (I had to look that up in Wikipedia to refresh my memory!) ]