Data['id'] > 1 ){ $Data = array(); if( isset( $_POST['CID'] ) ){ $ECID = intval( $_POST['CID'] ); $QS = "SELECT * FROM camera_streams WHERE camera_id={$ECID}"; $Result = $DATABASE->Query($QS,false); foreach( $Result as $CD ){ $cnode['id'] = $CD['id']; $cnode['name'] = $CD['name']; $cnode['size'] = $CD['img_width'].'x'.$CD['img_height'].'@'.$CD['fps']; $cnode['encode'] = $CD['compression_type']; $cnode['bitrate'] = $CD['bitrate']; $Data['nodes'][] = $cnode; }; }; echo json_encode( $Data ); } else { header('location: /'); }; ?>