Im running a script on my site and i need a script insertion to find duplicate urls . This is a large directory and would like to delete all my doubles. Does anyone here have experience with this. I am willing to pay to have it done. Thanks Kevin
do a loop in your server-side language available to you. First do a select with all the url's loop through all the url's and run a delete query comparing the current url in the loop: "Delete Blah From Blah Where URL = URLFIELD". Also - you probably want to trim() and convert chars to lower prior to the compare.
Im not sure if this will work im a dummy with PHP. Not sure if your interested in doing this for me. We can arrange something. Thanks Kevin
Unless I'm reading things completely cross-eyed, that will delete every record that has that URL. If this is the way he's handling things, he'd want to delete every record except the current one. And this is assuming the URL's are stored in an SQL-based database (which, admittedly, is *probably* a pretty safe assumption). ezmoney, basically, we need more info to help. How are those URL's stored? Is there a list of them in a database? Or is it an old-style directory, with the links built into the actual files? Do you want things changed so no URL gets referenced more than once, from anywhere? Or do you just want to make sure that one doesn't show up more than once per page? Or (and I think this was sort of ccoonen's original assumption) do you have multiple database entries that reference the same URL, you want to get rid of those, and you're confident that this will leave your site working fine?
I am thinking that one url per site is much better than having it on other pages. Im not sure if it hurts the SEO of the site to the url on other pages but better safe than sorry. All urls are in a database. I purchased this site and the script is personally made by the person i purchased from so no idea if it is old or new. Site is about 6 months old. Not sure if the links are built in to files or not. I would assume they are. The url in question is directorynew.com. Thought that might help. Thanks for helping Kevin
I guess that is not that hard... to clear duplicate url... $rst =mysql_query("Select * from table order by url"); $datas = mysql_fetch_array($rst); do{ $id=$datas[id]; if ($lasturl==$datas[url]) { mysql_query("DELETE FROM table where id = '$id'"); } $lasturl = $datas[url]; }while($datas = mysql_fetch_array($rst)); Code (markup): Little bit messy but this script will remove duplicate url but not 100% effective.
This might or might not be true, depending on how the directory's set up, and the size of the directory. If you have 8 billion different categories, and a particular site shows up in 7 of them, that's probably a good thing. If you have 20 categories, and 4 different sites show up in all of them...not so much. That's just a guess, of course. <snip> If the URLs are in a database, then the links almost certainly are not in the files (those probably just have stuff to do database look-ups). So Pinoylto's [sp?] suggestion is probably the way to go, assuming that's what you really want to do. Just remember: Backup your database! It might, who knows? Either way, it sounds interesting. So I've added it to my todo list. Thanks, but I haven't helped yet. (Assuming you meant that for me in the first place)