MySQL Forums
Forum List  »  PHP

Re: sort Table for pairs
Posted by: Peter Brawley
Date: November 29, 2016 03:47PM

> "Nickel" is meant to be the name of the logged in user.

Meant to be by what?

Logged into what? The PHP app that is running?

> I have this name saved in the $_SESSION-Array.

Perhaps this is a data param to send to the query?

> In the fist step I select all rows of the table where emp or abs is equel to Nickel.

In the first step of what? Not, apparently, of the query we've been working on here.

> Now I would like to get the interlocuter of nickel in an extra
> first column of the output table of the mysql-query.

What if neither `abs` nor `emp` = 'Nickel'? Assuming that cannot occur, the Select expression would be ...

select if(abs='Nickel', emp, abs) as Interlocutor, ...

Options: ReplyQuote


Subject
Written By
Posted
November 28, 2016 06:37AM
November 28, 2016 11:10AM
November 28, 2016 04:08PM
November 28, 2016 04:55PM
November 28, 2016 08:37PM
November 29, 2016 03:04AM
November 29, 2016 10:01AM
November 29, 2016 01:33PM
November 29, 2016 01:56PM
November 29, 2016 03:23PM
Re: sort Table for pairs
November 29, 2016 03:47PM
November 29, 2016 05:55PM
November 29, 2016 07:26PM
November 30, 2016 06:41AM
November 30, 2016 10:42AM
November 30, 2016 10:48AM
November 28, 2016 08:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.