This topic is locked

SQL quesry adding 4 fields together as one

3/30/2012 11:03:21 AM
PHPRunner General questions
S
scoobysteve author

I have move over to PHPRunner because of a session timeout issue, now I need to include a query I had working in asprunner I want to create a vaule from 4 fileds that will make up a complete address for the google map. at the moment I was using this in ASPRunner
Town & " " & [State/County] & " " & Country & " " & Spare18 AS Spare20,
How do I end up with Spare20 resulting with the 4 values of Town State Country Zip sperated with a space. IE "Davenport Florida USA 33897"
Please if you can help this would be great
Kind Regards

Steve

J
John 3/31/2012

I too had to change from ASPR to PHPR in the past due to other reasons.
I am not certain if you are asking what is the correct SQL syntax to use or what is the correct PHP coding for an equivalent event.
The coding for SQL should be the same.
Here is a reference that I found useful when trying to convert ASP to PHP

http://www.design215.com/toolbox/asp.php
JD

S
scoobysteve author 4/1/2012



I too had to change from ASPR to PHPR in the past due to other reasons.
I am not certain if you are asking what is the correct SQL syntax to use or what is the correct PHP coding for an equivalent event.
The coding for SQL should be the same.
Here is a reference that I found useful when trying to convert ASP to PHP

http://www.design215.com/toolbox/asp.php
JD


JD I am trying to get this work in the Query section in the SQL tables in ASPRunner the correct combinations shows in the results in Sapare20 field, but when I use the same in PHP the results show a zero in the Spare20 field. I am using the following
Spare18,

Spare19,

Town & " " & State/County & " " & Country & " " & Spare18 AS Spare20,

Date,

comments

FROM tblproperties

ORDER BY INDEX DESC

C
cgphp 4/1/2012
SELECT

Spare18,

Spare19,

CONCAT(Town,' ',`State/County`,' ',Country,' ',Spare18) AS Spare20,

`Date`,

comments

FROM tblproperties

ORDER BY `INDEX` DESC
S
scoobysteve author 4/1/2012


SELECT

Spare18,

Spare19,

CONCAT(Town,' ',`State/County`,' ',Country,' ',Spare18) AS Spare20,

`Date`,

comments

FROM tblproperties

ORDER BY `INDEX` DESC



Thank you so much, I appreciate it a lot. Steve