Delete table record with foreign key

0

Where is the Error?

DELETE FROM postagens WHERE id='$p_id' AND u_id='$u_id' SET FOREIGN_KEY_CHECKS = 0;

Clarifications:

p_id = post id (primary key)

u_id = user id (foreign key)

    
asked by anonymous 01.04.2018 / 20:09

1 answer

0

I believe you should first run SET FOREIGN_KEY_CHECKS=0; and then DELETE FROM ...; . Both with their respective ; since they are distinct commands.

    
01.04.2018 / 20:48