Thilo Planz [TP], on Friday, January 28, 2005 at 18:31 (+0900) wrote
these comments:
TP> sub image_exist{
TP> my ($id, $date) = @_;
TP> my ($count) = $mydbh->selectrow_array (
TP> ' select count(*) from pic where id = ? ',
TP> {}, # no attributes
TP>
On 01/28/2005 03:55 AM, Ing. Branislav Gerzo said:
Hi all!
I have subroutine, that checks, if I already have in DB specified row:
sub image_exist {
my ($id, $date) = @_; #id is _always_ number
my $sth = $mydbh->prepare_cached("select ID from pic where id = ?");
$sth->execute($id);
Hi Branislav,
sub image_exist {
my ($id, $date) = @_; #id is _always_ number
my $sth = $mydbh->prepare_cached("select ID from pic where id = ?");
$sth->execute($id);
my $rows = $sth->fetchall_arrayref();
if ( @$rows[0] ) {
print "$id exist\n";
} else {
print
Hi all!
I have subroutine, that checks, if I already have in DB specified row:
sub image_exist {
my ($id, $date) = @_; #id is _always_ number
my $sth = $mydbh->prepare_cached("select ID from pic where id = ?");
$sth->execute($id);
my $rows = $sth->fetchall_arrayref();
if ( @$ro