$sth = $dbh->prepare("INSERT INTO walstock (sid, name, qty) VALUES (?,?,?)"); # ok, we have 3 placeholders, pass 3 params to the execute function. if ($sth->execute('DEFAULT', $Data1, $Data2)) { print "Worked, cool"; } else { print "Didn't work, uncool, error is: $DBI::errstr"; }