Using CONCAT_WS() With Server-Side Processing

Using CONCAT_WS() With Server-Side Processing

jekelijajekelija Posts: 2Questions: 0Answers: 0
edited February 2012 in General
Hi, I have a question regarding server-side processing. I am attempting to format the data I receive by using CONCAT_WS within my select statement in the server-side processing php file (based off of your example), like this:
[code] "SELECT C.id, C.name, CONCAT_WS(', ', L.column1, L.column2, L.column3), C.date
FROM CONTACT C LEFT JOIN LEAD L ON C.id = L.contactid WHERE L.interestedin_l = 'Yes'
GROUP BY C.id
$sWhere
$sOrder
$sLimit;"
[/code]

However, at the top of the server-side processing file, what should I then place in aoColumns? Clearly, the array $aColumns = array('id', 'name', 'column1', 'column2', 'column3', 'date') is not accurate, but then again I don't know what else I could put since then 3rd column isn't really a single column. Any help you could give me would be appreciated.

Thanks!

Replies

  • beginner_beginner_ Posts: 55Questions: 2Answers: 0
    Use the file as a template and customize it to your needs. Had to do it too for certain reasons (like LOB columns).

    While at first sight those files look confusing it should not be that hard to customize it. And you might actually learn a bit doing so!
  • jekelijajekelija Posts: 2Questions: 0Answers: 0
    Sorry, perhaps I should have been more clear. I am using the file as a template and attempting to customize it to my needs. I've done it in the past several times quite easily, however this customization is a bit tricky and I couldn't quite figure out how to do it properly. If you could offer any guidance it would be helpful.
  • beginner_beginner_ Posts: 55Questions: 2Answers: 0
    Well the simplest solution would be to hard code your SQL statements throught the file.

    Or maybe an entry in the columns array of

    "CONCAT_WS(', ', L.column1, L.column2, L.column3)"

    could work.
This discussion has been closed.