in reply to simple MySQL prob

You can MySQL do the checking for you:
$dbh->do('insert into foo values (x,y,z)'); if ($dbh->err && $dbh->err == 1062) { # we've got a duplicate }
If you wanted to replace an existing record, look up the syntax for REPLACE where you can do something like:
$dbh->do('replace foo values (x,y,z)');
Hope this helps...

gav^