I found a best solution. 
Extending idea of @Luki i wrote the following code and it give me too much satisfied answer. First use the following function.
function multi_statement()
{
    global $conn;
    $total_args = func_get_args();
    $args = implode($total_args,";");
    $args = "begin;".$args.";commit;";
    $number = 0;
    if($conn->multi_query($args))
    {
        do
        {
            if ($conn->more_results())
            {
                $number++;
            }
        }
        while($conn->next_result());
    }
    if($number < (count($total_args)+1))
    {
        $conn->query('rollback');
        echo "Sorry..!!! Error found in Query no:".$number;
    }
    else
    {
        echo "All queries executed successfully";
    }
}
Then I called the function with number of statements, all these statements are dependent on each other. In-case there is error in any query, no one query occur any changes in database.
    $statement1 = "INSERT INTO `pic_gall`.`admin` (`admin_id`, `username`, `password`) VALUES (NULL, 'as1', 'as1')";
    $statement2 = "INSERT INTO `pic_gall`.`admin` (`admin_id`, `username`, `password`) VALUES (NULL, 'as2', 'as2')";
    $statement3 = "INSERT INTO `pic_gall`.`admin` (`admin_id`, `username`, `password`) VALUES (NULL, 'as3', 'as3')";
    $statement4 = "INSERT INTO `pic_gall`.`admin` (`admin_id`, `username`, `password`) VALUES (NULL, 'as4', 'as4')";
    $statement5 = "DELETE from user where user_id = '12'";
multi_statement($statement1,$statement2,$statement3,$statement4,$statement5);