Jump to content

greatchap

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by greatchap

  1. All I need to do was add this line -> mysqli_set_charset($con, "utf8"); Thank you for your help
  2. Sometimes output is blank and sometimes its some JSON error. For e.g. see this text : NIFTY AS A DAY OF REST, GOES THROUGH AN INTRADAY CORRECTION, MARKETS REMAIN CHEERFUL – BUY ON DIPS If I do not change the "-" to something else the output is null/blank. My table are normal MyISAM engine MYSQL tables and field type is varchar.
  3. Hello Everyone, I have a PHP code that reads data from db table. Then it converts it into JSON and show it. However if data table field has - or so then it gives json error. For e.g. if($num > 0){ while($res = mysqli_fetch_array($query)){ $NDate = $res['NDate']; $Summary = substr($res['Summary'],0,256); /* CREATE ARRAY FOR SHORT TERM NEWSLETTER */ $newsletters[]=array('newsletter'=>array("RecID"=>$SNo,"Summary"=>$Summary)); } /* JSON OUTPUT*/ $json = array("AuthOK" => 'True',"newsletters"=>$newsletters); header('Content-type: application/json'); echo json_encode($json); How to solve the issue ? Regards, GR
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.