php数据库最少4个字母?

php db. Some of my entries in the db are 3 letters (no varchar needed really). When I run searches for these entries I get 0 results.

Not sure if this is set in phpadmin or in my code. I have attached my output snippet, assuming the error is with my line. (I've cut out preg_replace line).

$search_output = "";
if(isset($_POST['searchquery']) && $_POST['searchquery'] != "")
{
$searchquery = preg_replace('#[^a-z 0-9?!]#i', '', $_POST['searchquery']);
$sqlCommand = "SELECT id, a, b, c, d FROM db WHERE a LIKE '%$searchquery%'";
}

And my output snippet:

if($count > 0){
$search_output .= "$count result(s) for $searchquery"};

When the term is 3 letters - assume it is "get", $scount gives 0.

  $search_output = $count results message;

Not sure where my "glitch" is. phpadmin or my code? I suspect my code? But there's nowhere where I assign set a minimum limit....

You are Mysql with full text search indexes. By default only words with a minimum of 4 characters are indexed. (This is a setting though)

Read more about it here: https://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

And more specifically here: https://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html

The setting ft_min_word_len defines the minimum word length.

Depending on the type of search you need to be able to do, the full text search index might not be the thing you should be using. IIRC, for example, you can only search for entire words... So you need to ask yourself if this is what you want.