What am I doing wrong here? I am basically trying to have the script (php) delete duplicate entries in the database based on the 'title'.
PHP Code:
$result = mysql_query("SELECT *, count(*) cnt FROM orcasearch GROUP BY title HAVING cnt > 1");
while($r=mysql_fetch_assoc($result))
{
if (!mysql_query("DELETE FROM database1 WHERE title=".$r['title']))
{
echo mysql_error();
}
}
Any help is appreciated.
MySql Information
Last edited by neorunner; 02-11-2006 at 09:06 PM..
|