XML Parsing Error: no root element found

前端 未结 2 1120
我寻月下人不归
我寻月下人不归 2020-12-21 19:42

I am trying to search for all properties in a database that are in one suburb. I have read that it has something to do with the HTML code 204 but I still do not undertand wh

2条回答
  •  庸人自扰
    2020-12-21 20:21

    As you seem to be using an Ajax function that is not shown it is hard to determine the root cause of the problem because nothing above, as far as I can tell, would yield the error you allude to in the title of the posting - namely "XML Parsing Error: no root element found" - I wonder therefore if there should be a configuration option in Ajax.Request that needs to be set to deal with a basic string response?

    That aside you might be able to make use of the following - perhaps even for diagnosis purposes.

    prepare( $sql );
    
        if( $stmt ){
    
            $searcharea = $_POST['searchAreaBar'];
    
            $stmt->bind_param( 's', $searcharea );
            $stmt->execute();
            $stmt->store_result();
            $stmt->bind_result( $suberbs );
            $stmt->fetch();
    
            echo $stmt->num_rows()==0 ? "No" : "Yes";
    
        }
        $stmt->close();
        $db->close();
    ?>
    
    
    

提交回复
热议问题