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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.