views:

50

answers:

2

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

A: 

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
dcp
A: 

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.

Peter Loron
hm so im going to add a where url LIKE %...% and insert in another table if is the case..thank you, it should work
Pizza Overflow