/ Published in: SQL

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# -------------------------- # PREPARE the SQL my $sqlq= "insert into interesting_interfaces ". "(datetime_created, datetime_last_update, device, interface_id, interface, auto_interesting) ". "values (now(), now(),?,?,?,?) ". "on duplicate key update datetime_last_update = now(), interface_id = ?, ". "auto_interesting=?"; my $insert = $dbh->PREPARE($sqlq); $insert->EXECUTE($dev,$num,$name,$auto,$num,$auto); IF ($insert->errstr ne '') { print "$dev,$name - ($dev,$num,$name,$auto,$num,$auto) caused the following error:\n"; print $insert->errstr."\n" } ELSE { print "$dev,$name - ($dev,$num,$name,$auto,$num,$auto) successful:\n"; }
Comments
