mysql - display every record on new line in php response

355

$sql_query = "select * from app_faculty";

    $result = mysql_query($sql_query) or die("Error : ".mysql_error());

    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {      

         $summary_array["Id"]=$row["id"];
         $summary_array["Uid"]=$row["u_id"];
         $summary_array["Name"]=$row["name"];
         $summary_array["Detail"]=$row["detail"];
         $summary_array["Created_date"]=$row["created_date"];
         $summary_array["Updated_date"]=$row["updated_date"];
         $summary_array["Deleted"]=$row["deleted"];

         $business_array[] = $summary_array;


    }




$new_array["response"]= $business_array;    

$output = json_encode($new_array);

echo $output."<br />";

I want to display records from sql on new line after every { } brackets. It should be displayed one after another and within [ ] brackets

People are also looking for solutions to the problem: timer - Getting SUM by adding time in PHP

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.