Re: SQL Error: Unique key violated for forum_read and forum_notify [message #27872 is a reply to message #27842] |
Thu, 29 September 2005 00:48 |
awadallah
Messages: 11 Registered: September 2005 Location: Palo Alto, CA
Karma:
|
Junior Member |
|
|
ok, for now, I just changed the db_li function to be as listed below, not clean, but gets the job done till hosting provider figures out why mysql keeps returning 2000 for dupe key.
essentially just added "|| mysql_errno(fud_sql_lnk) == 2000" to the 2nd if condition.
function db_li($q, &$ef, $li=0)
{
$r = mysql_query($q, fud_sql_lnk);
if ($r) {
return ($li ? mysql_insert_id(fud_sql_lnk) : $r);
}
/* duplicate key */
if (mysql_errno(fud_sql_lnk) == 1062 || mysql_errno(fud_sql_lnk) == 2000 ) {
$ef = ltrim(strrchr(mysql_error(fud_sql_lnk), ' '));
return null;
} else {
die(fud_sql_error_handler($q, mysql_error(fud_sql_lnk), mysql_errno(fud_sql_lnk), get_version()));
}
}
|
|
|