MySQL Forums
Forum List  »  PHP

Re: sort Table for pairs
Posted by: Nickel Paulsen
Date: November 29, 2016 03:23PM

Peter Brawley Wrote:
-------------------------------------------------------
> I don't understand how your interlocutor is
> chosen.

"Nickel" is meant to be the name of the logged in user. I have this name saved in the $_SESSION-Array. In the fist step I select all rows of the table where emp or abs is equel to Nickel. Now I would like to get the interlocuter of nickel in an extra first column of the output table of the mysql-query.

For every row the interlocuter is the name of the two collums abs and emp that is not equal to "Nickel":

interlocutor |  abs |   emp  |    content  |  date 
-------------+--------+--------------------+--------- 
   Lisett    |Nickel| Lisett | bla bla bla | 4.12.1991   % the interlocutor is name in the collums abs end emp that is not equal to "Nickel" so it is Lisett
   Lisett    |Lisett| Nickel | bla bla bla | 2.10.1991   % see first line comment
   Lisett    |Nickel| Lisett | bla bla bla | 15.9.1991   % tsee first line comment
    Tom      |  Tom | Nickel | bla bla bla | 3.10.1991   % the interlocutor is name in the collums abs end emp that is not equal to "Nickel" so it is Tom
    Tom      |  Tom | Nickel | bla bla bla | 3.9.1991    % see first forth line comment
    Tom      |Nickel|   Tom  | bla bla bla | 1.9.1991    % see first forth line comment

let me know if there is a detail that is not clear!


Peter Brawley Wrote:
-------------------------------------------------------
> And if there are more requirements, let's have
> them all at once rather than drip-drip-drip.

I think these are all requirements!

Cheers Nickel

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
Re: sort Table for pairs
November 29, 2016 03:23PM
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.