Hello again,
I'm trying to create a form for a "delete user" action. I want to delete user entries in all relevant tables and delete the profile picture. So I tried a custom code (in PHP tags):
Well, it doesn't work... Do I have to connect to the DB in the custom code? I have a DB read action in the onload event...
Moreover, I want the user to be logged out after deleting his profile. How can I achieve that?
Thanks in advance.
Christian
I'm trying to create a form for a "delete user" action. I want to delete user entries in all relevant tables and delete the profile picture. So I tried a custom code (in PHP tags):
mysql_query("DELETE FROM kwm_users WHERE id = ". $form->data['id'] ."");
mysql_query("DELETE FROM kwm_arrange2drive WHERE user_id = ". $form->data['id'] ."");
mysql_query("DELETE FROM kwm_a2d_user WHERE user_id = ". $form->data['id'] ."");
mysql_query("DELETE FROM kwm_a2d_drivealert WHERE user_id = ". $form->data['id'] ."");
mysql_query("DELETE FROM kwm_car_offers WHERE user_id = ". $form->data['id'] ."");
mysql_query("DELETE FROM kwm_gadgets WHERE user_id = ". $form->data['id'] ."");
mysql_query("DELETE FROM kwm_contact_details WHERE name = ". $form->data['name'] ."");
unlink( $_SERVER['DOCUMENT_ROOT']."/mobil3/components/com_arrange2drive/media/users/{$form->data['avatar']}" );
Well, it doesn't work... Do I have to connect to the DB in the custom code? I have a DB read action in the onload event...
Moreover, I want the user to be logged out after deleting his profile. How can I achieve that?
Thanks in advance.
Christian