Re: [PHP-DB] isset or ! isset what is my problem?

2006-01-03 Thread Ralph
Actually this has nothing to do with rows. I'm just trying to  
substitute a value when a query returns an empty value.




On Jan 3, 2006, at 5:24 AM, El Bekko wrote:


On Monday 02 January 2006 7:54 pm, Ralph wrote:

I'm building a URL based on data extracted from mySQL and I want the
text space.gif used as my default value should the variable $picture
by NULL.

The results of the code below kick back a value for $picture when it
is set in the database, but ignores the space.gif if the database
result is empty.

If I flip the test from ! isset to isset then I get the space.gif  
for

each result.


I've had no luck searching out an answer.

Thanks in advance.

--The Code-


>
span>
>
span>

Showtime:  
Location: 



---END-


Seeing as you're querying, use mysql_num_rows() to check.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] isset or ! isset what is my problem?

2006-01-03 Thread El Bekko

On Monday 02 January 2006 7:54 pm, Ralph wrote:


I'm building a URL based on data extracted from mySQL and I want the
text space.gif used as my default value should the variable $picture
by NULL.

The results of the code below kick back a value for $picture when it
is set in the database, but ignores the space.gif if the database
result is empty.

If I flip the test from ! isset to isset then I get the space.gif for
each result.


I've had no luck searching out an answer.

Thanks in advance.

--The Code-





Showtime:  
Location: 



---END-


Seeing as you're querying, use mysql_num_rows() to check.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] isset or ! isset what is my problem?

2006-01-02 Thread Micah Stevens

NULL != Not set. 

isset() tests to see if the variable exists. If your variable has a null value 
it is set, it DOES exist, it just has NULL for a value. You should test for a 
null value if that's what you want:

if ($picture == null)

Or perhaps the empty() function might be what you're looking for. 

-Micah 


On Monday 02 January 2006 7:54 pm, Ralph wrote:
> I'm building a URL based on data extracted from mySQL and I want the
> text space.gif used as my default value should the variable $picture
> by NULL.
>
> The results of the code below kick back a value for $picture when it
> is set in the database, but ignores the space.gif if the database
> result is empty.
>
> If I flip the test from ! isset to isset then I get the space.gif for
> each result.
>
>
> I've had no luck searching out an answer.
>
> Thanks in advance.
>
> --The Code-
> 
> 
>  span>
>  span>
> 
> Showtime:  ['ShowTime']; ?> 
> Location:  ['Location']; ?>
>
>  ($rst_screenings)); ?>
>
> ---END-

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] isset or ! isset what is my problem?

2006-01-02 Thread John Meyer
On Monday 02 January 2006 8:54 pm, Ralph wrote:
> I'm building a URL based on data extracted from mySQL and I want the
> text space.gif used as my default value should the variable $picture
> by NULL.
>
> The results of the code below kick back a value for $picture when it
> is set in the database, but ignores the space.gif if the database
> result is empty.

Have you tried strlen()?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] isset or ! isset what is my problem?

2006-01-02 Thread Ralph
I'm building a URL based on data extracted from mySQL and I want the  
text space.gif used as my default value should the variable $picture  
by NULL.


The results of the code below kick back a value for $picture when it  
is set in the database, but ignores the space.gif if the database  
result is empty.


If I flip the test from ! isset to isset then I get the space.gif for  
each result.



I've had no luck searching out an answer.

Thanks in advance.

--The Code-


span>
span>


Showtime: ['ShowTime']; ?> 
Location: ['Location']; ?>


($rst_screenings)); ?>


---END-