DB error i cant figure out

Database error in 

Query:

				INSERT INTO `sys_acl_actions_track` (IDAction, IDMember, ActionsLeft, ValidSince)
				VALUES (3, 1397, 3, FROM_UNIXTIME(1279564987))

Mysql error: Duplicate entry '3-1397' for key 'PRIMARY'

Found error in the file '/home6/pinpal/public_html/mysiteDIR/inc/membership_levels.inc.php' at line 505.
Called 'db_res' function with erroneous argument #0.

and this is the file at line 505 in red

//member is requesting/performing this action for the first time, //and there is no corresponding record in sys_acl_actions_track table if(mysql_num_rows($actionTrack) <= 0) { //add action to sys_acl_actions_track table db_res( "INSERT INTO `sys_acl_actions_track` (IDAction, IDMember, ActionsLeft, ValidSince) VALUES ($actionID, $memberID, $actionsLeft, FROM_UNIXTIME($validSince))"); $result[CHECK_ACTION_RESULT] = CHECK_ACTION_RESULT_ALLOWED; return $result; } //action has been requested/performed at least once at this point //and there is a corresponding record in sys_acl_actions_track table $actionTrack = mysql_fetch_assoc($actionTrack); //action record in sys_acl_actions_track table is out of date $periodEnd = (int)$actionTrack['ValidSince'] + $periodLen * 3600; //ValidSince is in seconds, PeriodLen is in hours if($periodLen > 0 && $periodEnd < time()) { db_res(" UPDATE `sys_acl_actions_track` SET ActionsLeft = $actionsLeft, ValidSince = FROM_UNIXTIME($validSince) WHERE IDAction = $actionID AND IDMember = $memberID"); $result[CHECK_ACTION_RESULT] = CHECK_ACTION_RESULT_ALLOWED; return $result; } //action record is up to date

i can not fig out why im getting this error.

any suggestions community????

Quote · 19 Jul 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.