php - 如何使用连接查询从两个表中删除行数据???

标签 php mysql

sql查询:

table name : donersreport , register


delete from donersreport inner join register on donersreport.id = register.id where donersreport.id = '12';

我想从两个表中删除数据...

输出:

You have an error in your SQL syntax; check the manual that corresponds to 
your MySQL server version for the right syntax to use near 'inner join register 
on donersreport.id = register.id where donersreport.id = '12' at line 1

最佳答案

请尝试这个:

Yes you can use join in delete query.

Pl refer the following link for solution.

MYSQL - Delete Query with Join

-- 谢谢

关于php - 如何使用连接查询从两个表中删除行数据???,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22526392/

相关文章:

PhpStorm 无法识别方法

PHP:如何检查对象的属性是否有值?

mysql - 如何使用具有多个 GROUP BY、子查询和 WHERE IN 的查询优化查询?

php - 由于 MySQL 查询失败,从 PHP 中的 fatal error 中恢复

php - 是否有使用 Symfony 框架创建新 Controller 的命令?

php - 从所有列中选择 unique 到单个列中

php - 更新 MySQLI 中的参数

php - ON DUPLICATE KEY 不起作用

php - 通过jQuery ajax添加的数据不会自动识别HTML

php - 为什么我的准备好的语句不能正常运行?