Answer the question
In order to leave comments, you need to log in
How to change the field names for output from the database by condition?
Tell
try {
$this->db_iniciate_connect();
$this->generateSearchString($filters);
$rs = $this->db->query($this->strSql);
$suggestions = array();
while($row = $rs->fetch_assoc())
{
$suggestions[] = array
(
'id' => $row['id'],
'frm' => $row['frm']
);
}
echo json_encode(array('rows' => $suggestions));
}
Answer the question
In order to leave comments, you need to log in
- $suggestions[] = array
- (
- 'id' => $row['id'],
- 'frm' => $row['frm']
- );
+ $suggestions[] = $row;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question