Jump to content

finding duplicate values in database


TheTitans

Recommended Posts

I have two columns in a mysql table called evo_chain_id and evo_parent_id. They look like this:

 

mysqltable.png

 

I would like to check if two or more values in evo_parent_id are the same. If they are, execute one function. If not, execute another function. So, for example, because 265 appears in there more than once, the first function would execute. I think I'm suppose to do something with the SQL COUNT() function, but I'm not too sure how that works. Could some help me?

Link to comment
https://forums.phpfreaks.com/topic/130683-finding-duplicate-values-in-database/
Share on other sites

if you want them to be unique just assign the column auto_increment

 

if you dont want them to be unique

 

do a select call to search the table against the id before you call a function then depending on the mysql_num_rows you get back you can then decided to call which function.

Regards

Mark

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.