What I need
I have a database called dbtuts and it has total 7 tables.
Table names are tbl_uploads, variationtable1, variationtable2, variationtable3, variationtable4, variationtable5, variationtable6.
All these tables have a column called prjId
.
I want to delete a row from tbl_uploads table and from variationtable1 to variationtable6 whereby prjId is lets say xxxx .
But the problem is variationtable1 to variationtable6 may or may not have this xxxx data for prjId column.
Is there any way whereby I can execute a single query that will delete xxxx if there is such a data.
My Codes
I tried to do the following way, but it is not working.
$deleteQuery = "
DELETE
FROM dbtuts.tbl_uploads
, dbtuts.variationtable1
, dbtuts.variationtable2
, dbtuts.variationtable3
, dbtuts.variationtable4
, dbtuts.variationtable5
, dbtuts.variationtable6
WHERE prjId = 'xxxx'
";
$resultDeleteQuery = mysqli_query($conn,$deleteQuery);
Does anyone have some idea?