$var) // { // $column_i ++; // echo "Count Column : ".$column_i ."
"; // if($column_i == $count_column){ // if($key == "0"){ // // --- // }else if ($key == "1"){ // // --- // }else{ // $data .= '"'.$key . '":"' . $var . '"'; // } // }else{ // if($key == "0"){ // // --- // }else if ($key == "1"){ // // --- // }else{ // $data .= '"'.$key . '":"' . $var . '",'; // } // } // } // $num_row_i ++; // if($num_row_i == $num_rows){ // $data .= '}'; // }else{ // $data .= '},'; // } // //$data .= '},'; // } // $data .= ']' ; // $num_rows2 = mysql_num_rows($result); // $rows_i = 0; // while ($row = mysql_fetch_assoc($result)) { // echo $row["userid"]; // echo $row["fullname"]; // echo $row["userstatus"]; // } // for ($x = 0; $x < mysql_num_fields($objQuery); $x++) { // $fld = mysql_fetch_field($objQuery, $i); // echo "The number is: $fld->name : $x
"; // } // while ($i < mysql_num_fields($objQuery)) // { // $fld = mysql_fetch_field($objQuery, $i); // $data .= '"'.$fld->name.'",'; // $i = $i + 1; // } // $data .= ']'; //echo "SQL : ".$sql ."\n" ; //echo $data; // $data = '[' ; // while($row_post = mysql_fetch_array($objQuery)) // { // echo "

" . $row_post['section_name'] . "

"; // } // $data .= ']'; //echo "\n"; // $data = '[' ; // $data .= json_encode($post); // $data .= ']'; // $arr = array('isError' => false , 'data' => $isCount ? $post[0]["c"] : $data ); // $json_data = '{'; // $json_data .= '"isError":false,'; // if($isCount){ // $json_data .= '"data":'.$post[0]["c"]; // } // else { // $json_data .= '"data":'.$data; // } // $json_data .= '}'; // echo $json_data; //$post= mysql_fetch_array($result); // $post = mysql_fetch_assoc($result); // mysql_free_result($result); $post = array(); while($row = mysql_fetch_assoc($result)){ $post[] = $row; } mysql_free_result($result); $arr = array('isError' => false , 'data' => $isCount ? $post[0]["c"] : $post); //echo json_encode($arr); $json = new Services_JSON; echo $json->encode($arr); mysql_close($objConnect); // echo json_encode($arr); //echo $arr; //echo "\n"; //var_dump($post); //echo "\n"; //print_r($post); ?>