you are using Limit 1, which makes the query targets only one row. if you want to delete all rows that match your where condition. try this :
mysql_query("DELETE FROM users_companies WHERE bedrijf_id = '$_GET[del]'") or die(mysql_error());
Question
When a user wants to delete his company it deletes just 1 record but all mathces should be deleted not just one.
mysql_query("DELETE FROM `users_companies` WHERE `bedrijf_id`=".$_GET['del']." LIMIT 1") or die(mysql_error());
This code just delete one record but has to delete all records, can someone help me?
Solution
you are using Limit 1, which makes the query targets only one row. if you want to delete all rows that match your where condition. try this :
mysql_query("DELETE FROM users_companies WHERE bedrijf_id = '$_GET[del]'") or die(mysql_error());