fetchrow_hashref gives error

fetchrow_hashref gives error

am 30.03.2004 15:40:08 von atif

hello everybody:

when I do fetchrow_hashref after execute it gives error:

DBD::mysql::st fetchrow_hashref failed: fetch() without execute()
*********lines where error*****************
$sth->execute();
$ref=$sth->fetchrow_hashref;
*******************************************

and why is this error emerging...

Use of uninitialized value in numeric eq (==)
******************line where error*******************
if ($equal_date==1)
*****************************************************

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: fetchrow_hashref gives error

am 30.03.2004 20:08:04 von Garth Webb

--=-fQGKFkBavy94zCvPPFxt
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2004-03-30 at 05:40, atif wrote:
> hello everybody:
>=20
> when I do fetchrow_hashref after execute it gives error:
>=20
> DBD::mysql::st fetchrow_hashref failed: fetch() without execute()
> *********lines where error*****************
> $sth->execute();
> $ref=3D$sth->fetchrow_hashref;
> *******************************************

As Rudy Lippan pointed out in the post before, you aren't checking
return values. Whether you are watching the database through other
means or not, there's no substitute for catching and printing any
errors. Its likely that your execute did not succeed. To confirm,
change your code to output the error:

$sth->execute() or die $dbh->errstr;

> and why is this error emerging...
>=20
> Use of uninitialized value in numeric eq (==)
> ******************line where error*******************
> if ($equal_date==1)
> *****************************************************

Because $equal_date is undefined.

--=20

|- Garth Webb -|
|- garth@zappos.com -|

--=-fQGKFkBavy94zCvPPFxt
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQBAabeEZJKKSGXZQTcRAnq3AKC2CPHosXlwGUDS+VwUCpHeQa4v2ACe LLPO
3VTQ6EOzmm62VVv/oVPTRz8=
=IG+L
-----END PGP SIGNATURE-----

--=-fQGKFkBavy94zCvPPFxt--

Re: fetchrow_hashref gives error

am 30.03.2004 20:08:04 von Garth Webb

--=-fQGKFkBavy94zCvPPFxt
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2004-03-30 at 05:40, atif wrote:
> hello everybody:
>=20
> when I do fetchrow_hashref after execute it gives error:
>=20
> DBD::mysql::st fetchrow_hashref failed: fetch() without execute()
> *********lines where error*****************
> $sth->execute();
> $ref=3D$sth->fetchrow_hashref;
> *******************************************

As Rudy Lippan pointed out in the post before, you aren't checking
return values. Whether you are watching the database through other
means or not, there's no substitute for catching and printing any
errors. Its likely that your execute did not succeed. To confirm,
change your code to output the error:

$sth->execute() or die $dbh->errstr;

> and why is this error emerging...
>=20
> Use of uninitialized value in numeric eq (==)
> ******************line where error*******************
> if ($equal_date==1)
> *****************************************************

Because $equal_date is undefined.

--=20

|- Garth Webb -|
|- garth@zappos.com -|

--=-fQGKFkBavy94zCvPPFxt
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQBAabeEZJKKSGXZQTcRAnq3AKC2CPHosXlwGUDS+VwUCpHeQa4v2ACe LLPO
3VTQ6EOzmm62VVv/oVPTRz8=
=IG+L
-----END PGP SIGNATURE-----

--=-fQGKFkBavy94zCvPPFxt--