When a PHP function does something you cannot do in SQL, you could call PHP from your queries using the Gearman UDF. https://launchpad.net/gearman-mysql-udf In most cases this should be faster than a stored function. I hope that in the future this will change, but who knows... Regards, Federico -------------------------------------------- Mer 19/3/14, Roberto Spadim <roberto@spadim.com.br> ha scritto: Oggetto: Re: [Maria-discuss] help - i'm not finding one sql function A: "pslawek83" <pslawek83@o2.pl> Cc: "Maria Discuss" <maria-discuss@lists.launchpad.net> Data: Mercoledì 19 marzo 2014, 16:18 wow! thanks kk i was trying to find a php like functionyour idea is very nice :) thank you! substr_count => (length(field)-length(replace(' ','',field))) /) 2014-03-19 12:16 GMT-03:00 pslawek83 <pslawek83@o2.pl>: Hi Roberto, You'll have to replace char => empty and get the difference in length. SELECT (length("banana") - replace("n", "", "banana")) There's probably no "standard" function to do that. Dnia 19 marca 2014 15:51 Roberto Spadim <roberto@spadim.com.br> napisał(a): hi guys, i'm not finding a function to return how many character i have, for example: "banana" i want a function that return 2 "n" characters, example: substr_count("banana","n") => 2 sorry it a begginners question, but i didn't found it in mysql/mariadb manual -- Roberto Spadim SPAEmpresarial Eng. Automação e Controle -- Roberto Spadim SPAEmpresarialEng. Automação e Controle -----Segue allegato----- _______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp