$ST=$DBH->prepare(< ?) if exists (select * from tbl where hostname=?) update tbl set timestamp=? where hostname=? else insert tbl (hostname, timestamp) values (?, ?) EOSQL $ST->execute($timestamp, $hostname, $timestamp, $hostname, $hostname, $timestamp); #### $ST=$DBH->prepare(<?) update tbl set timestamp=? where hostname=? EOSQL $ST->execute($hostname, $hostname, $timestamp, $hostname, $timestamp, $timestamp, $hostname);