'SELECT IF ( table.competition IN ( \'column1\', \'column2\', \'column3\', \'column4\' ), \'First\', table.competition ) AS competition, --- lots more code --- GROUP BY competition ORDER BY FIELD(table.competition,\'First\',\'FA Cup\',\'League Cup\') ASC ;'); [/CODE]
This basically takes a lot numbers from columns 1,2,3,4 adds them up and displays them under First. Is it possible to add another if to the start of the query? I want to take info from columns 5 and 6 but this has to go under a different column to First.
[CODE] SELECT IF ( table.competition IN ( \'column5\', \'column6\' ), \'Second\', table.competition ) [/CODE]
Then the ORDER BY FIELD would change to
[CODE] ORDER BY FIELD(table.competition,\'First\',\'FA Cup\',\'League Cup\',\'Second\') ASC [/CODE]
Does anyone know how the Ghostery extension works in Google Chrome? I switched to that quite a while ago, from uBlock Origin after uBlock started having issues just working. Personally I love Ghostery and I think it does a fantastic job, and I really enjoy the whitelist I have built up as well for tons of websites that don't serve ads so that it isn't blocking good elements of them by accident.
>pointed to a British firm called SafeToNet
There it is. Some UK MP's brother/friend/spouse owns this shitware company and wants those kickbacks right into their own pocket.
DNS based blocking only works as long as the ads are served from hosts than the content. Closing that loophole would be pretty easy. I'd say it sits in a sweet spot of being just nerdy enough that the average person doesn't set it up, meaning it isn't really on the big companies' radars.
Question
marklcfc
At the moment I have a query that looks like this
This basically takes a lot numbers from columns 1,2,3,4 adds them up and displays them under First. Is it possible to add another if to the start of the query? I want to take info from columns 5 and 6 but this has to go under a different column to First.
SELECT IF
( table.competition
IN
(
\'column5\',
\'column6\'
),
\'Second\',
table.competition
)
[/CODE]
Then the ORDER BY FIELD would change to
ORDER BY FIELD(table.competition,\'First\',\'FA Cup\',\'League Cup\',\'Second\') ASC
[/CODE]
Does anyone know if that be done? :blush:
Link to comment
https://www.neowin.net/forum/topic/1136832-php-query-help/Share on other sites
1 answer to this question
Recommended Posts