Hi David:

I am assuming you are using DBI.

I am not quite sure what you are asking, but here is some code that might
help:
while ($hashref = $sth->fetchrow_hashref) #while there are records in the
query ...
{
    DO SOME STUFF
}
The above code is a pretty traditonal way to deal with a statement handle
from DBI.

If you want to test if a query result is simply empty or not, you could do
something like the following:
if ($hashref = $sth->fetchrow_hashref) #then the query did not return an
empty set
{
       DO SOME STUFF
}
This code will tell you if a statement handles has any records.

I am not sure if this is what you are looking for, perhaps you could provide
some more detail about what you are trying to do.

Good luck,

Matt

Matthew P Baranowski
Data Manager, Office of Educational Assessment
University of Washington

----- Original Message -----
From: David Wu <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 2:59 PM
Subject: mysql NULl value in perl problem


> Hi guys,
>
> Running into a frustrating problem. When I have a empty table in mysql
> database, i tried run a select statement in my perl script and
> supposing get a NULl return value. Is the NULL returned from mysql is
> described as string in perl or as undef in perl?.. As there is no the
> word NULL in perl
> Thank you very much guys
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to