dimanche 13 décembre 2015

PHP - Pair up people from database

I have to make a button and if that button is clicked it has to pair up every Name in my database called that is called "inschrijvingen". But there cannot be double pairs.

So example;

I have 'John' , 'Eric' , 'Chelsea' and 'Peter' in my database ("Inschrijvingen"). Then if the button is clicked i have to get something like:

John has to buy a present for Eric

Eric has to buy a present for Chelsea

Chelsea has to buy a present for Peter

Peter has to buy a present for John

And if for example John logs in, he sees that he has to buy a present for Eric, and what kind of present Eric wants.

I have no idea how to do this but I heard something about Arrays, Sessions and Shuffle aka Random().

  • My database name is "Inschrijvingen"
  • My session is called 'adminsession'
  • The database "Inschrijvingen" has ID , Name , password , age , present

EDIT: This is my new and better explanation. Hope you guys can help me I have been struggling with this forover 3 days.




Aucun commentaire:

Enregistrer un commentaire