Jump to content

PHP & MySQL waiting list


Recommended Posts

I am in the process of creating a waiting list that I want to work automatically. When a new member registers for membership, the member must be on a waiting list for a while before the member gets permanent membership. When the membership is activated by me, I want this to work like when I delete the person who is number 1 in the list, and number 2 will be number 1. the remaining numbers in the list will automatically move a number up, just now . 5 will be number 4 and so on. PErson number one is the person that allways will be deleted from the waiting list. An idea would be that this persons name ande rest of data connected to hes membership number will be moved automaticaly to the permanent members list when hi is deleted from the waiting list. Only the name will be displayed in the member list, but the form that the new member submits will have several fields. There are t12 fields to be filled in in the MySQL database, but only the name and surname to be displayed in the list. The numbers will be generated automatically in front of the name.

I have tried to do this by myself. I have tried to do this myself, but I do not succeed. I am very new when it comes to PHP and programming in general. Hope someone here can help me with this. I can not find out.

Edited by LeonLatex
Link to post
Share on other sites

If you're having problems with the stuff you've written so far then posting the stuff you've written so far would make it a lot easier for us to identify why you're having problems.

That said, you want to show numbering on the page, right? Don't put the number in the database. Just use a variable like $row = 1, output $row where you want to show it, then $row++ so it'll be ready for the next person (if there is one).

Link to post
Share on other sites

Of course ... 😞 I deleted everything I had done. The only thing I have left is the MySQL DB. I deleted it because I was so upset that I did not make it work. I had then done this PHP script for 3 days and I have hardly slept. Now i dont know what to do.

 

Link to post
Share on other sites

don't actually move any data between tables. in fact, once 'live' data is inserted into a table, it is almost never actually deleted. all you need to do is record and use a 'status' value.

you should have a user table that holds the unique, one-time, user information. the auto-increment integer id column in this table establishes a user_id that you would use to relate any other user data, such as the user's status, back to the user it belongs to. you would have a status table that defines the different status values (id and name columns.) the auto-increment integer id column in this table establishes a status_id that you would use to relate any status data back to the status name. you would then have a user_status table (id, user_id, status_id, datetime, ... columns) that is used to hold the user status records. you would insert a new row in this table for each transaction that affects a user's status. when the user registers, after you insert the row in the user table, you would get the last insert id from that query, then insert a row in the user_status table with a status_id value that corresponds to a 'new' non-approved user. you would query to get a list of the 'new' users to select which one(s) you want to approve. when you submit this information, you would insert new row(s) in the user_status table with the selected user_id and the status_id value that corresponds to the 'approved' state (or any other state you specifically select via a form input.) to query to get the 'current' status for any user(s), you would get the group-wise latest/highest row per user_id value.

Link to post
Share on other sites

mac_gyver: This is the kind of help i want. Then i can look up and if i have further questions i hope i can come back and ask for help, tips and how to/best way to do it. Thanks mac_gyver for puting me in the right direction. I will look throug this and save it localy at my network.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.