1

today I have a problem which does not make sense and I cannot figure out how to do it, it consists in that when making a query in phpmyadmin which in its where clause has a word with tilde it generates its respective results but when doing it in php with mysqli does not generate anything, and I do not understand why since the where clause works with special characters like the 'ñ' since I have tested it and it works but with tilde no, the column count is in utf8_general_ci so that it can handle all kinds of special character, I have changed its collation to utf8_spanish_ci to see if it was the collation that did not accept accents but no, even so with this last collation it still does not generate results the same as with the previous collation in php but if in phpmyadmin without any inconvenience I do not understand why the php does not generate the results and the phpmyadmin if

Note: there is no problem with the results of the query since I have validated that in none of them it returns a special character

Php code:

<?php
$conexion = mysqli_connect("localhost", "admin", "123", "school");
$consulta="select * from users where localidad='Cúcuta'";
$resultado=mysqli_query($conexion,$consulta);
while($registro=mysqli_fetch_array($resultado)){
    echo 'Successfull';
}
mysqli_close($conexion);
?> 
user3783243
  • 5,368
  • 5
  • 22
  • 41

0 Answers0