0
如果我從JOIN
查詢中獲取結果,如何爲每個連接中的每個表獲取單獨的變量?如何在連接中將每一個MySQL表分割成單獨的變量
例如:
$result = $mysql->query(sprintf('SELECT *
FROM `TableOne` one
JOIN `TableTwo` two ON (one.TwoID = two.TwoID)
JOIN `TableThree` three ON (one.ThreeID = three.ThreeID)
WHERE one.OneID = %u',
(int)$primary_key));
while ($row = $result->fetch_assoc()) {
// Instead of $row, I want:
// $one: all fields from TableOne
// $other: all fields from TableTwo and TableThree
}
這可以在一個循環中沒有做過3 – nogad