Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
758 B
14
Indexable
Never
if ($query) {
        $getEmailIdQuery = "SELECT AcctID FROM Tbl_Customer WHERE email = ?";
        $getEmailIdParams = array($txtemail);
        $getEmailIdResult = sqlsrv_query($conn, $getEmailIdQuery, $getEmailIdParams);

        if ($getEmailIdResult) {
            $row = sqlsrv_fetch_array($getEmailIdResult, SQLSRV_FETCH_ASSOC);
            $customerIdByEmail = $row['AcctID'];

            echo "Customer ID for email $txtemail: " . $customerIdByEmail;

            sqlsrv_free_stmt($getEmailIdResult);
        } else {
            echo "Error fetching Customer ID: " . print_r(sqlsrv_errors(), true);
        }
    } else {
        echo "Error in INSERT statement: " . print_r(sqlsrv_errors(), true);
    }
    sqlsrv_close($conn);
Leave a Comment