PHP/MySQL DELETE on multiple rows with inner join -


i'm working on website school project. i'm having trouble while trying delete multiples rows in database, here's query:

$dbh->query("delete enseigne e inner join cours c on c.id_cours = e.id_cours e.id_prof = '$id_prof' , c.id_matiere = '$matt' ");

with $id_prof , $matt can replaced number inferior 5.

the 2 tables have 2 columns:

  • enseigne has id_prof , id_cours
  • cours has id_cours , id_matiere

my problem error 1064 while running command , after 3h changing query still haven't found problem.

if want delete enseigne query be

delete e  enseigne e  inner join cours c on c.id_cours = e.id_cours  e.id_prof = '$id_prof'  , c.id_matiere = '$matt' 

and deleting both tables

delete e , c enseigne e  inner join cours c on c.id_cours = e.id_cours  e.id_prof = '$id_prof'  , c.id_matiere = '$matt' 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -