0
I am in the struggle of a system in php and mysql sales system etc.. it has everything working, but accurate at the time of sale, the person can search both for (idCodigo or Description). without having two search tabs. wanted to put Two LIKE to search by (idCodigo, Description) soon would have an OR in the middle but not getting it. Follow the Working Code with DESCRIPTION search only
public function autoCompleteProdutoSaida($q){
$this->db->select('*');
$this->db->limit(5);
$this->db->like('descricao', $q); "no caso aqui teria que ter um OR e um LIKE, porém não estou acertando."
$this->db->where('saida',1);
$query = $this->db->get('produtos');
if($query->num_rows() > 0){
foreach ($query->result_array() as $row){
$row_set[] = array('label'=>$row['idCodigo']. ' | '.$row['descricao'].' | Preço: R$ '.$row['precoVenda'].' | Estoque: '.$row['estoque'],'estoque'=>$row['estoque'],'id'=>$row['idProdutos'],'preco'=>$row['precoVenda']);
}
echo json_encode($row_set);
}
}
I believe you are using some framework or library, if yes which?
– Costamilam
I’m using, bcit-ci/Codeigniter * twbs/bootstrap * jquery/jquery * jquery/jquery-ui
– Felipe Castro