Re: [PHP] mysql case statement

2010-06-28 Thread David McGlone
On Monday 28 June 2010 11:14:53 Andrew Ballard wrote: > On Mon, Jun 28, 2010 at 10:27 AM, David McGlone 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

Re: [PHP] mysql case statement

2010-06-28 Thread Andrew Ballard
On Mon, Jun 28, 2010 at 10:27 AM, David McGlone 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 yo

Re: [PHP] mysql case statement

2010-06-28 Thread David McGlone
On Sunday 27 June 2010 22:12:41 Brandon Rampersad wrote: > no At least smack me and give us an explanation. :-) -- Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql case statement

2010-06-28 Thread David McGlone
On Monday 28 June 2010 09:49:55 Andrew Ballard wrote: > On Sun, Jun 27, 2010 at 4:08 AM, Tanel Tammik wrote: > > Hello, > > > > how to select only if value is present? > > > >$query = $db->query("select menus.id, menus.name, > > case > >when panels.id is not null then '1' > >

Re: [PHP] mysql case statement

2010-06-28 Thread Andrew Ballard
On Sun, Jun 27, 2010 at 4:08 AM, Tanel Tammik wrote: > Hello, > > how to select only if value is present? > >    $query = $db->query("select menus.id, menus.name, >      case >        when panels.id is not null then '1' >        end as hiddenpanel > >    from " . \DB_MENUS . " as menus >      left

Re: [PHP] mysql case statement

2010-06-27 Thread Brandon Rampersad
no On Sun, Jun 27, 2010 at 8:29 PM, David McGlone wrote: > On Sunday 27 June 2010 04:08:24 Tanel Tammik wrote: > > Hello, > > > > how to select only if value is present? > > > > $query = $db->query("select menus.id, menus.name, > > case > > when panels.id is not null then '1' >

Re: [PHP] mysql case statement

2010-06-27 Thread David McGlone
On Sunday 27 June 2010 04:08:24 Tanel Tammik wrote: > Hello, > > how to select only if value is present? > > $query = $db->query("select menus.id, menus.name, > case > when panels.id is not null then '1' > end as hiddenpanel > > from " . \DB_MENUS . " as menus >

[PHP] mysql case statement

2010-06-27 Thread Tanel Tammik
Hello, how to select only if value is present? $query = $db->query("select menus.id, menus.name, case when panels.id is not null then '1' end as hiddenpanel from " . \DB_MENUS . " as menus left join " . \DB_HIDDENPANELS . " as panels on (menus.id = panels.men