Sure, thats the delete command:
I have a table called "newsletters":
+----------------+------+--------+
| email | mens | womens |
+----------------+------+--------+
|
test1@test.com | 0 | 1 |
|
test2@test.com | 1 | 1 |
+----------------+------+--------+
What I want to do is make it so after PHP unregisters a user, it checks the database to see if they are signed up to any other newsletters, and if they arn't, then to delete the key (email) from the table:
Unregistering an e-mail address from the mens newsletter would go something along the lines of this:
$query = "INSERT INTO newsletters(email, mens) VALUES('$email', 0) ON DUPLICATE KEY UPDATE mens = 0";
if (MySQL table newsletters(email == $email + womens == 0) {
$query = "delete from testdb.newsletters where email='$email'";
}
This is the line where I need PHP to check, the rest of the code is fine. This line is made up - to give an idea of what I'm trying to do.
Code:
if (MySQL table newsletters(email == $email + womens == 0) {