0
$deleteUser = $_POST['userId'];

$query =    "DELETE FROM users AS USERS
           LEFT JOIN posts AS POSTS
           ON USERS.id = POSTS.postAuthor
           WHERE USERS.id = '$deleteUser' AND POSTS.postAuthor = '$deleteUser'";

ユーザーと、ユーザーが作成した可能性のある投稿を削除しようとしています。私は何が欠けていますか?

4

1 に答える 1

1

が実行されるテーブルまたはエイリアスを指定しDELETEます

DELETE USERS FROM users AS USERS
       LEFT JOIN posts AS POSTS
       ON USERS.id = POSTS.postAuthor
WHERE USERS.id = '$deleteUser' AND POSTS.postAuthor = '$deleteUser'
于 2012-11-08T05:30:05.787 に答える