View Full Version : User deletion from MySql
malebeauty
6-24-05, 02:25 PM
I have a user php script based on mySql. I try to delete the expired users, everytime I do it, I have to go to myPhpadmin. I am trying to come up with a script that has check boxes where you can check and delete the ones that expired. My understanding in php and mySql is limited. Can someone help me out or refer me to a site? Thank you.
RTH10260
6-25-05, 01:15 PM
I have a user php script based on mySql. This works probably for some specific application, how about telling people what you are using it for ? In addition, if this is for a major package, check at the producers website and ask for an extension or a mod, something already made.
Ditto to what richard said. Also, deleting them from phpmyadmin may be a bad idea. Many user systems have other tables of data that relate to them. If you do not delete all the data that refers to that user, you could cause the application to not function.
malebeauty
6-25-05, 01:41 PM
I wrote the script by myself by reading some book. I want to display all the members that subscribe to my website. I do have the column of expire_date. I want to have a check box next to each one. I know you can do it with a function like while(). The question is how I delete the ones that expired. Thank you.
RTH10260
6-25-05, 03:04 PM
I wrote the script by myself by reading some book. I want to display all the members that subscribe to my website. I do have the column of expire_date. I want to have a check box next to each one. I know you can do it with a function like while(). The question is how I delete the ones that expired. Thank you.How-to, very short:
First webpage/script: write a query, SELECT * FROM users WHERE expirationdate < today();, and generate a FORM using the names retrieved and define a checkbox for each, use the action to point to the second script.
In the second script you look for the checkbox values sent back from the form. For each you use a sql query of DELETE FROM users WHERE userkey = key-from-form;.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.