Link to home
Create AccountLog in
Avatar of pda4me
pda4me

asked on

MySQL Query combine two columns in PHP

I am using the following MySQL query in PHP.  How do I combine the values in each record for StreetNu and StreetNa into a single column of data using this query?  Right now it splits them out as two seperate columns.

SELECT  MLNumber AS Home_ID, StreetNu AS StreetNumber, StreetNa AS StreetName City AS City, State AS State, ZipCode AS zip, MarketingRemarks AS description, SubdivisionDisplay AS neighborhood, ListingPrice AS price, VirtualTourURL AS virtual_tour_1, Bedrooms AS bedrooms, Bathrooms AS bathrooms_full, SquareFootage AS living_area FROM MyTable
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

select CONCAT(StreetNu , ' ', StreetNa ) streetinfo from mytable
Avatar of pda4me
pda4me

ASKER

that does not work when I try to insert into the existing sql statement?

to be more clear I need StreetNu and StreetNa to be a column (AS) called StreetInfo just like the other column treatments you see.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of pda4me

ASKER

thanks!