LeonLatex Posted February 26, 2021 Share Posted February 26, 2021 (edited) 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 February 26, 2021 by LeonLatex Quote Link to comment https://forums.phpfreaks.com/topic/312217-php-mysql-waiting-list/ Share on other sites More sharing options...
requinix Posted February 26, 2021 Share Posted February 26, 2021 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). Quote Link to comment https://forums.phpfreaks.com/topic/312217-php-mysql-waiting-list/#findComment-1584777 Share on other sites More sharing options...
LeonLatex Posted February 26, 2021 Author Share Posted February 26, 2021 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. Quote Link to comment https://forums.phpfreaks.com/topic/312217-php-mysql-waiting-list/#findComment-1584778 Share on other sites More sharing options...
requinix Posted February 26, 2021 Share Posted February 26, 2021 Step away from the computer. Get a sandwich. Watch TV. Kill things in a videogame. Come back to it another time. Quote Link to comment https://forums.phpfreaks.com/topic/312217-php-mysql-waiting-list/#findComment-1584779 Share on other sites More sharing options...
mac_gyver Posted February 26, 2021 Share Posted February 26, 2021 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. Quote Link to comment https://forums.phpfreaks.com/topic/312217-php-mysql-waiting-list/#findComment-1584780 Share on other sites More sharing options...
LeonLatex Posted February 28, 2021 Author Share Posted February 28, 2021 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. Quote Link to comment https://forums.phpfreaks.com/topic/312217-php-mysql-waiting-list/#findComment-1584795 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.