Perhaps a bit on the side of your problem, but could be safty net to avoid duplicate entries or errors on unique keys.
You can put ON DUPLICATE KEY UPDATE in a INSERT statement, which results in an update instead of an insert if the primary key is the same.
Heres an example
$insert=sprintf("INSERT INTO vgpressstatus
VALUES ('%s',%d,'%s',%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,
STR_TO_DATE('%s','%%Y-%%m-%%d %%T'), STR_TO_DATE('%s','%%Y-%%m-%%d %%T'),
STR_TO_DATE('%s','%%Y-%%m-%%d %%T'), STR_TO_DATE('%s','%%Y-%%m-%%d %%T'),
STR_TO_DATE('%s','%%Y-%%m-%%d %%T'),NOW())
ON DUPLICATE KEY UPDATE
press=VALUES(press),
product=VALUES(product),
stateload=VALUES(stateload),
statephase=VALUES(statephase),
statenet=VALUES(statenet),
statebreak=VALUES(statebreak),
grosscopies=VALUES(grosscopies),
netcopies=VALUES(netcopies),
nominalcopies=VALUES(nominalcopies),
allowancecopies=VALUES(allowancecopies),
pressspeed=VALUES(pressspeed),
maxpressspeed=VALUES(maxpressspeed),
copiesperrev=VALUES(copiesperrev),
plannedstart=VALUES(plannedstart),
plannedend=VALUES(plannedend),
start=VALUES(start),
runningstart=VALUES(runningstart),
estimatedend=VALUES(estimatedend),
oppdatert=NOW()",
$row['press'],$row['prodno'],
mysql_real_escape_string($row['product']),
$row['stateload'],$row['statephase'],
$row['statenet'],$row['statebreak'],$row['grosscopies'],$row['netcopies'],$row['nominalcopies'],
$row['allowancecopies'],$row['pressspeed'],$row['maxpressspeed'],$row['copiesperrev'],$row['plannedstart'],
$row['plannedend'],$row['start'],$row['runningstart'],$row['estimatedend']
);