This week's book giveaway is in the Cloud/Virtualization forum. We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line! See this thread for details.
I am having trouble updating it. I have two tables one is employees and other is attendance.
employees table has fields as (id, employee_id, firstname, lastname, address, email, salary, creacted_on) and attendance table has fields as (id, employee_id, date, time, description). Here is my code for editing.
You may want to explain the problem a bit more. You mentioned you have a trouble updating the table for what it seems, however, that was it. It may be hard for somebody to help you - there could be many troubles.
I don't know of any dialect of SQL that allows one SQL command to update more than one table at a time.
You can use a SELECT with a JOIN to figure out which rows to update, but each table must be updated separately.
Obviously that, however, poses a risk - what would happen if another user tried to access that data after the first table had been updated but before the second table was updated?
The solution to that is to wrap the updates in a transaction. Begin the transaction, do each table update, then commit the transaction. You may need to turn auto-commit off on your database to make that work. Also, if there is a problem while doing updating, you'd rollback the transaction rather than committing it.
Transactions make the updates an atomic operation, so there is no risk of someone getting in there while things are only half-done. It's all or nothing.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.