Nik has asked for the wisdom of the Perl Monks concerning the following question:
i try the above to check if there are any records returned but it fails. any idea why?$st = $db->prepare( "SELECT count(*) FROM members WHERE user=?" ); $st->execute($user); $rows = $st->fetchrow_array(); if ($rows) { print font( {-size=>5, -color=>'Lime'}, "Το όνομα Χρήστη είναι π +ιασμένο! Παρακαλώ διάλεξε ένα άλλο!" ); exit 0; }
i am trying the above to get the total number of rows returned from the sql statement but it aint working why?$st = $db->prepare( "SELECT count(*) FROM members" ); $st->execute(); $row = $st->fetchrow_hashref; print $row->{'count(*)}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fetching rows problem
by b10m (Vicar) on Feb 25, 2004 at 21:32 UTC | |
|
Re: fetching rows problem
by matija (Priest) on Feb 25, 2004 at 21:24 UTC | |
by cchampion (Curate) on Feb 25, 2004 at 23:50 UTC |