I want delete all data from tables ( topics and hits_counter ) , topic_id col in table1 = post_topic col in table 2 , i don't know where's the problem .
Code :
$stmt = $con->prepare("DELETE FROM topics INNER JOIN hits_counter ON
topics.topic_id = hits_counter.post_topic WHERE topics.topic_id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
You need to mention from which tables you want to delete if there is more than one in the statement
DELETE hits_counter, topics
FROM topics
INNER JOIN hits_counter ON ...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.