In PHP, how do I deal with the PHPcode of the associated table? for example, A user table is used, A user is added to the comment table, and user A is added to the favorites table, if you delete user A, post published by user A, post comments, and favorites, how should you deal with similar problems? /****************** How to deal with joined tables in PHP
PHP code
For example, User A has published an article, commented by user B, and added to user C. If user A is deleted, how to deal with similar problems in the comments and collections of articles? /*************************************** **/In addition, how does php implement joined table operations ~ Add, update, and delete
------ Solution --------------------
Delete the article and delete the corresponding comments and favorites.
Multiple tables can be connected. For example, left join/right join/inner join is recommended to check mysql multi-table operations.
------ Solution --------------------
Multi-table operations: table Sharding is performed on one table;
Only query is associated.
Http://user.qzone.qq.com/937461184/blog/1330412851
------ Solution --------------------
You can delete the mysql table, that is, when you delete an article, you are also deleting comments and favorite articles.
------ Solution --------------------
If you have uploaded files and are commented by users, add them to favorites.
If you delete this file. So other users' comments and collections should not be available. This is the first consideration.
If you think this is all deleted. Delete a trigger based on the id or create a trigger.
If you don't think it is necessary to delete it, then ..