I hope you can help me with this doubt,
Given the following php code that connects to a sql server database:
$sql = "select * from tabla1 where campo1 like '%ñ%'" ; $datos = $this->objeto->listar() ; $numRegistros = sqlsrv_row_num($datos) ; print_r($numRegistros) ;
The result on the screen is 0. If I remove the where the result is 219, that is, all the records in the table. I know that in the table there are at least 20 results with ñ. That is, it does not recognize special characters when doing the where. The same thing happens with the accents.
The query is correct, copied and pasted in the management studio returns the 20 results. The functions utf8_encode and utf8_decode do not work for me, or at least I do not know how to do it.
Can you help me with the problem?