my $pidsql = "select id from ezcontentobject where name='$username' and contentclass_id=4"; my $idsql = $dbh->prepare($pidsql); $idsql->execute();