Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001041

Re: [PHP-DB] odbc_fetch_row From: joerg andreas (joerg.andreas <email protected>)
Date: 04/14/01

Try this: Ask for the length of the data returned by your SQL-Query.

$fieldcontent = odbc_result($yourResultID,"YourField")
if len($fieldcontent)=0 then...

If Lenght of Datastring is Zero then the string is really empty.

Happy eastern, Joerg Andreas
--------------------------------------

"Randall Barber" <rdb55 <email protected>> schrieb im Newsbeitrag
news:000a01c0c469$56f6f810$4f14bb80 <email protected>
When I run a query, even if it is empty I still get a valid identifier for
the result.

How do I determine that there is nothing in the result, even though the
result is valid (just empty)?

I thought about odbc_fetch_row, but that moves the pointer forward and I
don't want that; there may be valid info.
I tried odbc_result'ing a COLUMN and it returns NULL not error, so I can't
test against that.

One thought is to see if all columns in my query are NULL and then "No rows
were found". Is there a simpler way?

How does odbc_result_all determine there is nothing present?

Thanks
RDB

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>