Creating a booking based on a POST request I want to make a booking entry. I want to ask whether the code that i wrote below is rightly format or not?

I haven't tried it, because there's still more code that needs to be written. I just want to ask this before I continue to write.

&lt;?php
    require 'Connection.php';

    //Check Connection
    if ($conn-&gt;connect_error){
        die("Connection Failed: ". $conn-&gt;connect_error);
    }

    //Create Variable Submitted Booking
    $MarketingName = $_POST["Marketing"];
    $CustomerName = $_POST["CustName"];
    $CustomerEmail = $_POST["CustEmail"];
    $HouseID = $_POST["IDHouse"];
    $UnitNo = $_POST["UnitNo"];
    $Remarks = $_POST["Remarks"];

    //Select All Data in Database
    $sql = $conn-&gt;prepare ("SELECT Property_No FROM cust_bookedfr WHERE Property_No = '" . $UnitNo . "' ");
    $result = mysqli_query($conn, $sql);

    if ($result-&gt;num_rows &gt; 0) {
        //Validate Username
        echo "Property Unit is already taken.";

    } else {
        echo "Creating a Booking.";

        if (filter_var($Marketing, FILTER_SANITIZE_STRING)) {
            if (filter_var($CustName, FILTER_SANITIZE_STRING)) {
                if (filter_var($Cust_Email, FILTER_SANITIZE_EMAIL)) {
                    if (filter_var($HouseID, FILTER_VALIDATE_INT)) {
                        if (filter_var($UnitNo, FILTER_SANITIZE_STRING)) {
                            if (filter_var($Remarks, FILTER_SANITIZE_STRING)) {
                                //Insert the Username and Password into Database
                                $sql2 = $conn-&gt;prepare ("INSERT INTO cust_bookedfr (NULL, Marketing_Name, Cust_Name, Cust_Email, Property_Name, Property_ID, Property_No, Property_Qty, Property_Price, Remarks, DateAccess)
                                VALUES ('" . $MarketingName . "', '" . $CustomerName . "', '" . $CustomerEmail . "', 'Fajri Residential', '" . $HouseID . "', '" . $UnitNo . "', '', '', '" . $Remarks . "', NOW())");
                                if ($conn-&gt;query($sql2) === TRUE) {
                                    echo "New record created successfully";
                                } else {
                                    echo "Error: " . $sql2 . "&lt;br&gt;" . $conn-&gt;error;
                                }
                            }
                        }
                    }
                }
            }   
        }
    }
$sql-&gt;close();
$sql2-&gt;close();
$conn-&gt;close();

?&gt;
If you are going to use a prepared statement (please do) then go the extra step of using placeholders and bound parameters. Your queries are not currently stable/secure.
If you don't truly need Property_No for anything, just return COUNT from your first query, and evaluate that value as a boolean (loose truthy comparison).  This is cleaner and more deliberate, I reckon.
Your code is suffering from excessive tabbing (aka "arrowhead" code). This increases the likelihood that you or future devs will need to tediously scroll horizontally to review/manage the code.
If all of the conditions must be true to reach the INSERT query, then just use one condition statement with the expressions separated by &amp;&amp;.