so i have a page where a user can submit his own links
i dont want to make a script that do everything automatic, i just want to make a page where, when the .php find a possible duplicated link, i get a warning like "ID 22 could possible have the same link as ID 738"
i only need like the query to do that...if its possible with that..i can only use php and mysql
if its too expensive (memory, cpu..) i can make like a submit button then when pressed generates like a report
ps: just to be clear, im not showing the message to the user, is something im going to put at my admin cp..and its not comparing "link 1" to "link 2" but searching the entire database thanks
If you want to know which links are used by more than 1 ID, you could do something like this:
SELECT link,COUNT(id)
FROM link_table
GROUP BY link
HAVING COUNT(id) > 1
Your best bet would be to have a query that runs when new links are submitted. It could do something like this as a basic example:
SELECT * FROM links
WHERE url
= ""
If that returns results, then you have a dupe which can either be prevented from being inserted into the database, or simply flagged somewhere for review.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.