getting data from database not working for me

Hi,

I have a Mysql database and following the examples provided I can’t get it to work on loading a simple datatable. If I run my php script by itself I get the following results
[{“FLAG_ID”:“1”,“FLAG_TYPE”:“OK”},{“FLAG_ID”:“2”,“FLAG_TYPE”:“PARTS ON BACK ORDER”},{“FLAG_ID”:“3”,“FLAG_TYPE”:“PART FAIL”},{“FLAG_ID”:“4”,“FLAG_TYPE”:“WAITING ON CUSTOMER”},{“FLAG_ID”:“5”,“FLAG_TYPE”:“IT PROBLEM”},{“FLAG_ID”:“6”,“FLAG_TYPE”:“PARTS MISSING”},{“FLAG_ID”:“7”,“FLAG_TYPE”:“IWI PROBLEM”}]

If I run it through the webix program all I get is the hearders. Here is my webix program

Loading from an external data file
Loading from an external data file (xml, json etc.)
JSON Example
    <script type="text/javascript" charset="utf-8">
    webix.ready(function(){
    grida = new webix.ui({
    	container:"testA",
    	view:"datatable",
    	columns:[
                { id:"FLAG_ID",	header:"ID", width:50, height:50},
                { id:"FLAG_TYPE",	header:"FLAG_TYPE",width:200, height:50},
    	],
    	autoheight:true,
    	autowidth:true,
    	url:"query_data_2.php"
        });	
    });
    </script>
</body>

and here is my php file that works independently.

<?php // CONNECT TO THE DATABASE $DB_NAME = 'floor_tracker'; $DB_HOST = 'localhost'; $DB_USER = 'mysecret_user_name'; $DB_PASS = 'mysecret_user_password'; $mysqli = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME); if (mysqli_connect_errno()) { printf("Connect failed: %s\ ", mysqli_connect_error()); exit(); } //query status_flag table $query = "SELECT * FROM status_flag"; $res = $mysqli->query($query); //convert data to json $data = array(); while ($rec = $res->fetch_array(MYSQL_ASSOC)) //each row $data[] = $rec; //output json echo json_encode($data); // CLOSE CONNECTION $res->close(); $mysqli->close();

NEVER MIND!!! it decided to start working fro no apparent reason. My guess was that there must had been an additional echo statement and webix was being confused. I guess the only output has to be be a single json encoded echo. “echo json_encode($data);”