Thanks for any helpsub checkDuplicateName { my($db, $name) = @_; my $sth; my $rv; my @row; my $duplicate; $sth = $db->prepare('SELECT "Names" FROM Customers WHERE "Names" = + ?'); $rv = $sth->execute($name); while(@row = $sth->fetchrow_array) { next; } if(undef $row[0]) { $duplicate = 0; } else { $duplicate = 1; } return $duplicate; }
In reply to Database stuff by Raziel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |