MySQL Wildcards in Android Studio

0

I have made a query in MySQL and it works perfectly until the wildcard% is introduced in front of the text to be searched with LIKE (behind it goes well)

This is the query:

SELECT id_ave, DATE_FORMAT(fch_ave,'%d/%m/%Y') AS 'fecha',  
 zon_ave, cli_ave, per_ave, tip_ave, IFNULL(nom_tip_ave,'Sin tipo') AS 'tipos', est_ave, pri_ave, des_ave, img_ave, IFNULL(nom_zon,'Sin zona') AS 'zonas', IFNULL(nom_cli,'Sin cliente') AS 'clientes', IFNULL(nom_est,'Sin estado') AS 'estados'   
FROM (((ctrl_averias LEFT JOIN ctrl_zonas ON ctrl_averias.zon_ave = ctrl_zonas.id_zon) 
LEFT JOIN ctrl_clientes ON ctrl_averias.cli_ave =  ctrl_clientes.id_cli) 
LEFT JOIN ctrl_tipos_averias ON ctrl_averias.tip_ave = ctrl_tipos_averias.id_tip_ave) 
LEFT JOIN ctrl_estados ON ctrl_averias.est_ave = ctrl_estados.id_est 
WHERE (nom_cli LIKE 'afa%') 
ORDER BY pri_ave DESC, est_ave ASC'

When executing it directly on the MySQL database it is perfect but when I try to execute it from the app, it tells me that no result has been produced or for example the results are produced from the third character, that is, if I search " bar the transporter "and I write"% bar% "there is no result, but if I type"% carrier% "yes.

The application is developed in Android Studio and launches a webservice to obtain the results of the search against the MySQL database.

Help please !!!!! I'm going crazy.

    
asked by apozatoza 27.08.2018 в 10:02
source

0 answers