how to make sure multiple mysql queries executed successfully
I have about 6 queries need to be executed successfully. Now I am using
mysqli_query function to execute all the queries. How can I make sure all
the queries executed successfully ? I tried a try catch method, but it's
not working.
mysqli_query($connection,start)
try{
mysqli_query($connction,query1)
mysqli_query($connction,query2)
mysqli_query($connction,query3)
mysqli_query($connction,query4)
mysqli_query($connection,commit)
}catch($e){
mysqli_query($connection,ROLLBACK)
}
What is wrong with this query ? Is there a better method for this?
No comments:
Post a Comment