I know how to properly change the MySQL ft_min_word_len
configuration variable, but what I can't seem to easily find in the PHP & MySQL documentation (maybe I'm not using correct search terms) is if there's a way to programatically get the value of ft_min_word_len
using PHP. My search engine should throw an error if the query contains search terms shorter than ft_min_word_len
and it'd be helpful if it could do it automatically without me remembering to set a variable.
You can use show variables and retrieve its value from php.
show variables like 'ft_min%'
From php
$query = mysql_query("show variables like 'ft_min%'") or die(trigger_error());
$num = mysql_fetch_row($query);
echo $num[1];
Just for your information you can get this value even from the information_schema
select variable_value from information_schema.global_variables
where variable_name like 'ft_min%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With