0
$app->get('/partner_push/:event_id', function($event_id) {
    $response = array();
    $result = array();
    $db = new DbHandler();

    // fetching all user tasks
    $result[0] = $db->getevent_partner_pushdata($event_id);
    $result[1] = $db->getevent_organiser_pushdata($event_id);
    //echo '<pre>';print_r($result);die;
    $response["error"] = false;
    $response["push"] = array();

    for($i=0;$i<count($result);$i++){

    if(!empty($result[$i])){
          // pushing single chat room into array
    while ($fetch_room = $result[$i]->fetch_assoc()) {
        $tmp = array();
        //print_r($fetch_room);die;
        if($i==0){
        $tmp["push_from"]= "partner";
        $tmp["pushID"] = $fetch_room["pushID"];
        $tmp["pushEventID"] = $fetch_room["pushEventID"];
        $tmp["pushpartnerID"] = $fetch_room["pushpartnerID"];
        $tmp["push_message"] = utf8_encode($fetch_room["description"]);
        $tmp["partner_name"] = utf8_encode($fetch_room["establishment"]);
        $tmp["time_stamp"] = $fetch_room["created"];

        } else{
        $tmp["push_from"]= "organiser";
        $tmp["pushID"] = $fetch_room["orgpushid"];
        $tmp["push_message"] = utf8_encode($fetch_room["des"]);
        $tmp["pushEventID"] = $fetch_room["orgEventID"];
        $tmp["pushpartnerID"] = $fetch_room["orgID"];
        if(!$fetch_room["artwork"]=="" || !$fetch_room["artwork"]==null)
        {
                    $url = "https://*********/pushImg/";    
                    $tmp["attachment"] = $url.$fetch_room["artwork"];
                    $tmp["attachmentname"] = $fetch_room["artwork"];

        }
        $tmp["organiser_name"] = utf8_encode($fetch_room["firstname"]." ".$fetch_room["lastname"]);
        $tmp["time_stamp"] = $fetch_room["created"];

        }
                array_push($response["push"], $tmp);        
     }
    }

    }

    echoRespnse(200, $response);
});

In database, changed the collation type of column ("description")to "utf8-general-ci". Multilingual data is storing in database but while reading , its displaying as"??????". In web app, multilingual data is displaying. but while retrieving in mobile and postman, data is displaying as "????". How to resolve this? kindly suggest

vaishu
  • 1
  • 7
  • No. can you please tell me, what shoud be the value for this header ? – vaishu Nov 28 '18 at 10:32
  • 1
    Are there incorrect characters going into the database or when displayed back on the page. If they are displayed on the page, please include the code that does that. You may need `` in your HTML `` section. – MattMS Nov 28 '18 at 10:35
  • @MattMS No. In database , characters are storing and displaying properly. only in postman and android, characters are not displaying – vaishu Nov 28 '18 at 10:41
  • Maybe have a look at https://stackoverflow.com/questions/4076988/php-json-encode-json-decode-utf-8 – MattMS Nov 28 '18 at 10:45

0 Answers0