function search_review($input, $serviceName){
$ipJson = json_encode($input);
$this->db->select('*');
$this->db->from('reviews');
$this->db->where('reviewee_name', $input['reviewee_name']);
$query = $this->db->get();
$result = $query->result();
if (!empty($result)) {
foreach ($query->result() as $row)
{
$data['reviewer_id'] = $row->reviewer_id;
$data['reviewee_name'] = $row->reviewee_name;
$data['tournament_played_c_s'] = $row->tournament_played_c_s;
}
$data['message'] = 'Review details retrieved successfully.';
$status = $this->clamo_lib->return_status('success', $serviceName, $data, $ipJson);
} else {
$data['message'] = 'Unable to retrieve review details.';
$status = $this->clamo_lib->return_status('error', $serviceName, $data, $ipJson);
}
return $status;
}
这是我的代码,我可以检索具有相同名称的单行数据。例如 reviewee_name="sangeetha" 意味着我需要显示名称为 sangeetha 的详细信息。但现在只有单行数据我得到了我需要做的事情?