Forums

How to use where command for following results

thehitechpanky 15 Sep, 2012
Below is the table I want to fetch my info from
[attachment=2]SKC Data Table.jpg[/attachment]
I want to fetch my info from the column "field_id" and the column "value"
I want to display it in such a way that if value in "field_id" is 61, column1 shows the value in "value"
Otherwise column2 shows value in "value"
Data to be fetched like this
[attachment=1]SKC Data fetch.png[/attachment]
Result is to be something like this
[attachment=0]SKC Result.jpg[/attachment]
GreyHead 17 Sep, 2012
Hi thehitechpanky,

I haven't tested it but it looks as though the latest version of ChronoConnectivity has added the option to let you add more complex MySQL queries in the Fields List (optional) box. You could try something like this
IF (`field_id` = 61, `value`, 0) AS `column1`, IF (`field_id` = 62, `value`, 0) AS `column2`, 


Bob
Max_admin 18 Sep, 2012
Hi,

Or may be use a "Custom listing" and control where to display the data ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
thehitechpanky 25 Sep, 2012
I don't know how to use custom listing, please help me out in this!

however as far as Frontend listing is concerned, its not taking the "If command"

Here's how I put the code suggested above
[attachment=1]refund code.png[/attachment]

But I got this as result 😟
[attachment=0]refund result.png[/attachment]
GreyHead 25 Sep, 2012
Hi thehitechpanky,

That appears to be dividing up on the commas. But it isn't the box I referred to. The Fields List (Optional) box is on the General | Advanced tab. It might be worth trying.

Bob
This topic is locked and no more replies can be posted.