select p.pcode,p.pname,p.psellprice,p.preserve,p.p_image01,p.stock_amount from ShopProduct p, s where s. = '1' and p.pcode = s.pcode and display = '1' order by p.updatetime desc You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= '1' and p.pcode = s.pcode and display = '1' order by p.updatetime desc' at line 1