Jump to content

Help with SQL query


El Heso

Recommended Posts

Hi!

Is it possible to make this happen?

 

$sql="SELECT CONCAT(contact) Contact, CONCAT(date) Date, 
CONCAT(p1453_01) '1. How old are you?', 
CONCAT(p1453_02) '2. Do you own a car?', 
CONCAT(p1453_03) '3. Have your friends a car?' 
FROM survey 
WHERE 
p1453_02 
like 'Yes%' ORDER BY datum DESC";

 

to this:

 

$sql="SELECT CONCAT( get value from other place ) get value from other place , CONCAT(get value from other place ) get value from other place , 
CONCAT(get value from other place ) ' get value from other place ', 
CONCAT(get value from other place ) ' get value from other place ', 
CONCAT(get value from other place ) ' get value from other place ' 
FROM survey 
WHERE 
get value from other place  
like 'get value from other place %' ORDER BY datum DESC";

 

I would like to set the value for each field from admin side of my site and then run the query

Hope you guys understand what i mean

 

Any advice?

 

Regards Tony

Link to comment
https://forums.phpfreaks.com/topic/247471-help-with-sql-query/
Share on other sites

$sql="SELECT CONCAT( get value from other place ) get value from other place , CONCAT(get value from other place ) get value from other place , 
CONCAT(t.fieldOne,"+",s.FieldTwo ) AS ' get value from other place '

FROM survey s JOIN adminTable t USING(id)
WHERE 
get value from other place  
like 'get value from other place %' ORDER BY datum DESC";

 

hope that helps

Link to comment
https://forums.phpfreaks.com/topic/247471-help-with-sql-query/#findComment-1271049
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.