If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Imo a more user friendly approach is to have a check box for each friend and the user then checks the check boxes for the friends they want to delete. This way you can delete multiple friends in one go rather than one friend at a time with a delete button for each friend.

When the friends to delete are all selected, the user can click a Delete selected friends button which then sends the userID linked to each check box to a server side script which then deletes the sent userID's and associated records from the database.

You can do all this with or without AJAX.

Reading your post it appears your next step could be working through the w3schools ajax tutorials to get the basics of ajax.

that would be a better approach, you're right.
I already went through the w3schools ajax tutorial, but it has nothing about deleting (or deleting multiple users, posts, whatever with checkboxes) out of the database. And I want to do it with AJAX because it wouldn't need to refresh the page (I'm doing this website for myself, not a customer or friend).

that would be a better approach, you're right.
I already went through the w3schools ajax tutorial, but it has nothing about deleting (or deleting multiple users, posts, whatever with checkboxes) out of the database.

The tutorial gives a basic demo on how to retrieve database information using ajax. The concept is the same whether you want to retrieve or delete records - the ajax function sends data to a server side script (PHP, ASP or whatever) which then performs the required tasks on a database and then returns any required data back to the ajax function.

In the link I posted, there is a schematic diagram of the ajax process which is the same whether you want to retrieve or delete records.

So in your case, you will need a php script that receives data from either 1 or multiple check boxes or a single delete button. That data (in this case userID's) is then inserted into an sql statement to delete the requested records for the sent userID's.