I want to execute multiple query like this
Delete FROM TableA where CreatedBy="2"
Delete FROM TableB where CreatedBy="2"
Delete FROM TableC where CreatedBy="2"
Delete FROM TableD where CreatedBy="2"
I also want to do more update and insert query using that id.Even id may change.
Every time I have to change the value to do that.
Is there any way declaring variable and execute the quires
As example
var userid=2;
Delete FROM TableA where CreatedBy="userid"
Delete FROM TableB where CreatedBy="userid"
Delete FROM TableC where CreatedBy="userid"
Delete FROM TableD where CreatedBy="userid"
Here if I only change one place the id which will change everywhere.
I want to make a sql file and run it to my MySQL server changing the userid.
Is there anyway to do that? and how?