<?php 

            $sql_user_dr1 = "SELECT direct_referral FROM tbl_user_account WHERE unique_id = '$orderunique_customer'";
            $result_user_details = mysqli_query($conn, $sql_user_dr1);
            $row_user_details = mysqli_fetch_assoc($result_user_details);
            $indrlevel1 = $row_user_details['direct_referral'];
            
            $sql_user_dr2 = "SELECT direct_referral FROM tbl_user_account WHERE unique_id = '$indrlevel1'";
            $result_user_details = mysqli_query($conn, $sql_user_dr2);
            $row_user_details = mysqli_fetch_assoc($result_user_details);
            $indrlevel2 = $row_user_details['direct_referral'];

            $sql_user_dr3 = "SELECT direct_referral FROM tbl_user_account WHERE unique_id = '$indrlevel2'";
            $result_user_details = mysqli_query($conn, $sql_user_dr3);
            $row_user_details = mysqli_fetch_assoc($result_user_details);
            $indrlevel3 = $row_user_details['direct_referral'];

            $sql_user_dr4 = "SELECT direct_referral FROM tbl_user_account WHERE unique_id = '$indrlevel3'";
            $result_user_details = mysqli_query($conn, $sql_user_dr4);
            $row_user_details = mysqli_fetch_assoc($result_user_details);
            $indrlevel4 = $row_user_details['direct_referral'];


            $sql_user_dr5 = "SELECT direct_referral FROM tbl_user_account WHERE unique_id = '$indrlevel4'";
            $result_user_details = mysqli_query($conn, $sql_user_dr5);
            $row_user_details = mysqli_fetch_assoc($result_user_details);
            $indrlevel5 = $row_user_details['direct_referral'];

?>