Hello,
First question: how to update 2 mysql tables with one query?
Another question: is possible to update and insert with the same query?
Thank's.
I don't think it is possible to update two tables with one query. And not to update and insert either. Can you explain why you want to do it with one query, then it's possible there is another solution for your problem.
Simple example:
Table deposits fields: uid,amount,status Table users fields: uid, balance
deposits
uid
amount
status
users
balance
I want to reduce a percent of deposits.amount and to add it to users.balance if deposits.status = 1.
Normally that is done with transactions. First start the transactions. Second insert the money into the new account. Third withdraw the amount from the first account. If everything works, then end transaction, otherwise rollback.
So i need to use InnoDB? Is it better than MyISAM (which i'm using now)?
I have no idea about either of those RDBMS. Hopefully someone else can help you further.