I am currently working on a website project. And for now in my sign.php file, at least 5 sql statement must be done. Normally I use mysqli_query function and if it does not return false, pass the next one. But what if one of them returns false? Previous statements are okey but remaining ones are going to be failed. So the user can not completely sign to system, only half of the database is updated.
if( mysqli_query( $con, $sql ) )
{
//do the next one
}
else
{
//everything messed up
}
This way does not confort me. The algorithm is poor quality. I do not know how to handle this problem. What is the best path I can follow to implement these operations?
Note: All operations are different. I have to use SELECT, INSERT, CREATE, UPDATE... Note2: If something is missed, I can edit the question.