cdherold has asked for the wisdom of the Perl Monks concerning the following question:
A MySQL related PERL question from a relative newbie.
I'm trying to get the id # for a press release with a given header ($header). Each header is unique. When I run the code below, however, and check the contents of $header_id, I find it contains the following : DBI::st=HASH(0x81b862c). Not what I need.
I checked to see if the id # was in $header_id[0] or $header_id[1], but both were empty (as far as I could tell).$header_id = $dbh->prepare("SELECT id FROM press_releases WHERE header + = '$header'"); $header_id -> execute();
Any advice on how I can get the id# out of the database as a single integer?
thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(ichimunki) Re: Retrieval of ID# as Integer from MySQL
by ichimunki (Priest) on Aug 07, 2001 at 22:33 UTC | |
|
(jeffa) Re: Retrieval of ID# as Integer from MySQL
by jeffa (Bishop) on Aug 07, 2001 at 22:43 UTC | |
|
(Ovid - security and bind variables) Re: Retrieval of ID# as Integer from MySQL
by Ovid (Cardinal) on Aug 07, 2001 at 22:58 UTC | |
|
Re: Retrieval of ID# as Integer from MySQL
by elbie (Curate) on Aug 07, 2001 at 22:55 UTC |