MySQL Delete-Select row -
i'm trying delete row table subscription there 2 foreign keys (id_user , id_journal). information have email table user , nome table journal. deleted row needs match user.email , journal.nome. can't find solution. how can it?
table user:
id name email password
table journal:
id name
table subscription:
id id_user id_journal
the last 2 queries tried:
delete assinatura ( select tbluser.id, journal.id tbluser, journal email = '$email' , nome = '$nome') delete assinatura inner join tbluser on (tbluser.email = '$email') inner join journal on (journal.nome = '$nome')
i've tried many others queries, unsuccessful. think it's important i'm new @ mysql.
delete subscription id_user in ( select usr.id user usr usr.email = input_email ) , id_journal in ( select jrnl.id journal jrnl jrnl.name = input_name )
Comments
Post a Comment