我有以下幾點:如何從MySQL Query(多級數組)中獲取變量?
$sql = "SELECT c.category_name
, c.category_name_url
FROM blog_categories AS c
JOIN blog_articles AS a
ON a.category_name = c.category_name
WHERE c.category_status = 'online'
GROUP BY c.category_name
";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
$category_name = $row['c']['category_name'];
$category_name_url = $row['c']['category_name_url'];
}
但它不工作(產生空白)。我確信我做錯了什麼,但我不知道我正在尋找什麼的正式條款,所以谷歌沒有幫助= /。
http://www.php.net/manual/en/function.mysql-fetch-array.php – Sinan
你爲什麼要參加在blog_articles - 它並不像你正在使用它呢? –