Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php

while ($array = mysqli_fetch_assoc($result)) {
    $cropData = array ( $array['foodName'] => 
                array( 'majorFoodName' => $array['majorFoodName'],
                       'quantity' => $array['quantity'],
                       'form' => $array['form'] ));
    $jsonData[$array['cropName']][] = $cropData;
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php
ADD COMMENT
Topic
Name
4+8 =