Php 附加到json_encode pho

Php 附加到json_encode pho,php,Php,我试图附加到json数据,但它不起作用,它只是返回一个空的结果文件,看到您刚刚附加到jsoneconde的输出,但可能是我做错了 //我们只想在这里使用简单的php json编码,不需要过于复杂 public function generate_json($table_data) { if($table_data) { $table_data= $this->get_property_gallery_data($table_data);

我试图附加到json数据,但它不起作用,它只是返回一个空的结果文件,看到您刚刚附加到jsoneconde的输出,但可能是我做错了

//我们只想在这里使用简单的php json编码,不需要过于复杂

public function generate_json($table_data)
{
    if($table_data)
    {            
       $table_data= $this->get_property_gallery_data($table_data);
       return json_encode($table_data);
    }

 }
/**
 * Function to get the table data for the items of a property
 * @author David Buckley
 */


public  function get_property_gallery_data($property_id)
{
      $where = $this->get_query_where();
      $query = "SELECT * FROM `#__{$this->items_table}` WHERE 1 " . $where;         
      $galleries = wpl_db::select($query, 'loadObjectList');        

      return $galleries;

}

您没有在方法中使用参数
$property\u id
get\u property\u gallery\u data


我真的不明白你想在这里做什么,但我可以想象,如果你没有选择正确的属性,你就无法从
get\u property\u gallery\u data
获得正确的数据。因此,
json\u encode
将无需编码

你的问题不太清楚。我建议您再次检查函数输入。尝试分解代码以查看哪部分出错。这里发生了很多事情,所以很难说你的问题在哪里。这个问题非常模糊。一定要纠正打字错误和错误。