我有4个相同的表,相同的行名带有diffrend值。我已经从另一页发送了$ _GET ['urun_barkod']代码,因此我试图在第二页上显示匹配的行以及详细的行信息。
$barko=$_GET['barkod'];
$urunsor=$db->prepare("SELECT * FROM kanyon UNION ALL SELECT * FROM zorlu UNION ALL SELECT * FROM
tesvikiye UNION ALL SELECT * FROM citys where urun_barkod=:barkod");
$urunsor->execute(array(
'barkod' => $barko
));
$uruncek=$urunsor->fetch(PDO::FETCH_ASSOC);
但是我无法正确获得结果。只想在我的第二页上显示匹配的barkod行,并提供详细信息。
我在做什么错?
如果ID相同,请尝试:
"
SELECT *
FROM ((kanyon INNER JOIN zorlu ON kanyon.id = zorlu.id)
INNER JOIN tesvikiye ON kanyon.id = tesvikiye.id)
INNER JOIN citys ON kanyon.id = citys.id
where urun_barkod=:barkod
"