tbl_product:
+------+------+------------+-------+
| id | code | name |brand|origin|
+------+------+------------+-------+
| 1 | 1001 | apple | X | a |
| 2 | 1002 | mango | V | b |
| 3 | 1003 | banana| Z | a |
+------+------+------------+-------+
tbl_product_price:
+------+------+------+
| id | code | price|
+------+------+------+
| 1 | 1001 | 250 |
| 2 | 1001 | 220 |
| 3 | 1002 | 175 |
| 4 | 1002 | 180 |
| 5 | 1003 | 170 |
| 6 | 1003 | 190 |
+------+------+------+
我有一个搜索框,如果我选择任何专业人士
SELECT a.id, a.pro_code, a.pro_unit, MIN(b.pro_price) FROM tab_product a INNER JOIN tab_product_price b WHERE pro_code like('" .$search . "%') ORDER BY pro_code LIMIT 5" 但没有 pro_code 显示在搜索框中。
请这个代码是好的!