Re: mysql case statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 28, 2010 at 10:27 AM, David McGlone <david@xxxxxxxxxxxxx> wrote:
> Tanel, we both learned something. I didn't fully understand join myself yet,
> but I think I do now.
>
> but let me ask this if the join wasn't there would an if statement like I
> mentioned have worked?
>
> Blessings,
> David M.

I think you are confusing a few things. You can't really rely on
testing "empty(DB_HIDDENPANELS)" because the value of the constant
DB_HIDDENPANELS is most likely a string that was set with an earlier
call to define. The OP could have tested for the column value
"hiddenpanel" using an if (...) test as you suggeted. However, given
that the OP stated he "would like to select hiddenpanel only if there
is a corresponding value in DB_HIDDENPANELS," the INNER JOIN will do
that at the database query level, so an if (...) then test in PHP
isn't really necessary.

Andrew

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux