Ask a Question related to ASP Database, Design and Development.
-
Chris Leonard #1
Returns a NULL field ?
Hi.
I'm stuck!
I am querying two tables in a DB using the following string
SQLQuery = "SELECT GuestBook.*, GuestPic.PicName FROM GuestBook LEFT JOIN
GuestPic ON GuestBook.id = GuestPic.id "
Sometimes there will not be a value in PicName so the query only returns the
values in the primary (left hand) table. In my script I need to test and see
if there is a value returned for PicName.
How do I do this ? If I check for a string using "" it fails, isEmpty fails
as well. I think it's because the string is NULL but I've no idea. Can
someone point me in the right direction please.
Here is the code I'm using
if isEmpty(rsGuestBook("PicName")) then
Response.Write(" ")
else
Response.Write("<img src='" & rsGuestBook("PicName") & "'>")
end if
TIA
Chris
Chris Leonard Guest
-
#40783 [Opn->Bgs]: odbc_close always returns null
ID: 40783 User updated by: j dot henge-ernst at interexa dot de Reported By: j dot henge-ernst at interexa dot de -Status: ... -
#26132 [Bgs]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
ID: 26132 User updated by: steven at pearavenue dot com Reported By: steven at pearavenue dot com Status: Bogus Bug... -
#26132 [Opn->Bgs]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
ID: 26132 Updated by: iliaa@php.net Reported By: steven at pearavenue dot com -Status: Open +Status: ... -
#26132 [Opn]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
ID: 26132 User updated by: steven at pearavenue dot com Reported By: steven at pearavenue dot com Status: Open Bug... -
#26132 [NEW]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
From: steven at pearavenue dot com Operating system: Redhat 9.0/Apache 2.0 PHP version: 4.3.4 PHP Bug Type: PostgreSQL... -
William Tasso #2
Re: Returns a NULL field ?
Chris Leonard wrote:
isNull is over there ------->>
> Sometimes there will not be a value in PicName so the query only
> returns the values in the primary (left hand) table. In my script I
> need to test and see if there is a value returned for PicName.
>
> How do I do this ? If I check for a string using "" it fails, isEmpty
> fails as well. I think it's because the string is NULL but I've no
> idea. Can someone point me in the right direction please.
>
--
William Tasso - [url]http://WilliamTasso.com[/url]
William Tasso Guest
-
Chris Leonard #3
Re: Returns a NULL field ?
Doh!!
Thanks, I really should have tried that one!
"William Tasso" <ngx@tbdata.com> wrote in message
news:eE$2XxOZDHA.2572@TK2MSFTNGP09.phx.gbl...> Chris Leonard wrote:>> >
> > Sometimes there will not be a value in PicName so the query only
> > returns the values in the primary (left hand) table. In my script I
> > need to test and see if there is a value returned for PicName.
> >
> > How do I do this ? If I check for a string using "" it fails, isEmpty
> > fails as well. I think it's because the string is NULL but I've no
> > idea. Can someone point me in the right direction please.
> >
> isNull is over there ------->
>
> --
> William Tasso - [url]http://WilliamTasso.com[/url]
>
>
Chris Leonard Guest



Reply With Quote

