
                                                                                                                                       

<?php
 define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'restax');
define('DB_PASSWORD', 'restax');
define('DB_NAME', 'Restax');

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$block_id = $request->getAttribute('block_id');

$response=array();

if(isset($block_id)){
	$sql="SELECT block_id, block_shortcode, floors FROM set_blocks WHERE block_id='$block_id'";
}
else{
$sql="SELECT * FROM set_blocks";
}
$result=mysqli_query($con,$sql);
    while ($row[]=mysqli_fetch_assoc($result)) {  
      $user=$row;
    }
    echo json_encode($user); 

?>