There are now 1,000 strings and a MYSQL dictionary. query the id of these 1,000 strings in MYSQL and output the results

  mysql, question

1. This is an example (txt file) that requires a string query.
vivo X5S L
CHE-TL00H
G621-TL00
vivo Y51A
KIW-AL10
Samsung SM-G9200
XiaoMi MI PAD
Samsung SM-G9008V
XiaoMi MI 4C
MX4 Pro
R7007
ALE-TL00
iPad3_4
XiaoMi HM NOTE 1TD
HUAWEI P7-L09
iPhone8_4

2. There is such a table in Mysql (example)
mid bid sid type productname
P1 mobile81 s000 mobile dopod S900(Touch Diamond)
P2 mobile81 s000 mobile dopod T8388 (Kirin)
P3 mobile81 s000 mobile HTC T8588 HD2
P4 mobile81 s265 mobile dopod S1 (Touch Edition)
P5 mobile81 s000 mobile dopod 696
P6 mobile81 s000 mobile dopod 838
P7 mobile81 s000 mobile dopod T2222(Touch Viva)
P8 mobile81 s265 mobile dopod S1
P9 mobile81 s000 mobile dopod T5399
P10 mobile81 s267 mobile dopod A6188
P11 mobile81 s264 mobile dopod D600 (Vital Edition)
P12 mobile81 s000 mobile dopod P800
P13 mobile81 s000 mobile dopod C720
P14 mobile81 s264 mobile dopod D600

3.
You need to query the result in 2 in 1 and return mid

$prodArr = explode("\n",file_get_content('prods.txt'));  //Get the text in txt and convert the string into an array according to the newline character
 $prods = implode(',',$prodArr);  //Turn product array into where condition
 $sql = 'SELECT mid FROM prods WHERE "productname" IN('.$prods.')';  //sql for combination query Mid

First of all, we have achieved one according to the main idea of the topic, which should be what the topic owner wants.

If you find any mistakes, you can clap your bricks hard.