0
我不能全文设置ft_min_word_len,因为我使用网络托管。
mysql匹配选择像标签,没有全文
DB领域
主题标签 - VARCHAR(256)/ utf8_general_ci
DB输入值例如
| #abc |
| #abc#123 |
| #123 |
| #abc#123 #abcd |
| #1234 | | #12345 |
我想搜索'#123'结果
| #abc#123 |
| #123 |
| #abc#123 #abcd |
PHP
$word = $mysqli->real_escape_string($_POST['word']);
mysqli_query($mysqli, "... where (p.hashtag REGEXP '^(.*?(\\\b$word\\\b)[^$]*)$') ... ");
我想比systax更多。
新增评论
DB输入值更详细
ID |标题|描述| hastag | viewCnt ...
1 | text1 | text0001 | #123 | 0
2 | text2 | text0002 | #123 #abc | 0
3 | text3 | text0003 | #12345 | 0
...
的感谢!但没有工作。搜索结果0. – Integral
@Integral。 。 。哎呀。我忽略了通配符。 –
谢谢!我可以应用索引来实现性能吗? – Integral