Avatar of Robert Granlund
Robert Granlund
Flag for United States of America asked on

Codeignitor Query

I have a query that works but I need to add to it and I am not sure how.  I need to pull two different fields.

Right now it looks like this
<?php
  SELECT
                CASE
                    WHEN o.business_type_id = 1 THEN o.first_name
                    WHEN o.business_type_id = 4 THEN o.legal_name 
                    ELSE o.business_name
                END 

Open in new window


But I need to pull the First_Name and the Last_Name

Like this:
<?php
  SELECT
                ### Line 1 ###
                CASE
                    WHEN o.business_type_id = 1[b] THEN o.first_name AND .o.last_name[/b]
                    WHEN o.business_type_id = 4 THEN o.legal_name 
                    ELSE o.business_name
                END 

Open in new window

PHP

Avatar of undefined
Last Comment
Sharath S

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Sharath S

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck