PHP返回多行

时间:2019-12-27 09:26:01

标签: php sql

这是sql的代码

$query = "SELECT B.ProductName,
B.productImageLink,
D.productPrice
FROM categoryToProduct A
INNER JOIN productDescription B ON A.ProductId = B.ProductId
INNER JOIN Product D ON B.ProductId = D.ProductId 
WHERE A.categoryID = 2 "
return $query->row;

请注意:当我在phpmyadmin中尝试时,它几乎返回20-30行

但是当我从视图页面print_r函数时,它仅返回1行。

我想要的是:我如何在foreach中返回多行,以出于产品目的将其分开

0 个答案:

没有答案