Re: get one column

2005-01-28 Thread mail-lists
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>

Re: get one column

2005-01-28 Thread Michael A Chase tech
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);

Re: get one column

2005-01-28 Thread Thilo Planz
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

get one column

2005-01-28 Thread Ing. Branislav Gerzo
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