in reply to Re: Re: DBI Select results confussion
in thread DBI Select results confussion
O.K., I think I see where the misunderstanding is. You're trying to arrange to have the result of the query show up in a variable. There are two ways to do that: you can do the appropriate binding to cause the result of a fetch to get stuffed into a variable, or you can fetch a row (either as an array or as a hash) and extract the value manually. You're trying to do the former; my snippet does the latter.
In both cases, unless a row is fetched, there's no value there to get. Hence you need to force a fetch.
I avoid using bind_column() et al. because I find the resulting code is harder to follow. Readers can easily follow code that manually fetches a row and extracts values, but using column binding forces readers to remember that there's a magic wormhole in that region of space that causes values to automagically appear elsewhere.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: DBI Select results confussion
by heezy (Monk) on Nov 11, 2002 at 16:04 UTC |