> -----Original Message-----
> From: Sterin, Ilya [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 04, 2001 1:02 PM
> To: Neil Lunn; 'Guangzu Wang (Houston)'; [EMAIL PROTECTED]
> Subject: RE: Only return the FIRST field from DBD/ODBC/Sql
> Server stored
> proce dure
> >
> > @list = $sth->fetchrow_array; # ie (1,2,3,4)
> > $scalar = $sth->fetchrow_array; # only gets 1st element $list[0]
>
> I believe that in a scalar contex it will return true or
> undef, but in the
> list context
> ($scalar) = $sth->fetchrow_array it will return the first element.
>
> Ilya Sterin
You're right, that's what fetchrow_array does. I never do this though, it
was just to illustrate a point about scalar context as oposed to list
context. This may have ben misread from the docs on selectrow_array:
the first row of data from the statement. If called in
a scalar context, it returns the first field of the
first row. The "$statement" parameter can be a
previously prepared statement handle, in which case
the "prepare" is skipped.
Neil
__________________________________________________________________________
Please Note :
Only the intended recipient is authorised to access or use this e-mail. If
you are not the intended recipient,
please delete this e-mail and notify the sender immediately. The contents
of this e-mail are the writer's
opinion and are not necessarily endorsed by the Gunz Companies unless
expressly stated.
We use virus scanning software but exclude all liability for viruses or
similar in any attachment.