我试图只使用 mysql_fetch_row 获取计数值,但回显是 Array9,而我只想要 9。
<?php
$result = mysql_query("SELECT * FROM `product_category` ORDER BY `product_category_name`");
while($row = mysql_fetch_array($result)) {
echo '
<li class="ui-shadow" data-count-theme="d">
<a href="' . $row['product_category_ref_page'] . '.php" data-icon="arrow-r" data-iconpos="right">' . $row['product_category_name'] . '</a><span class="ui-li-count">' .
$number = mysql_fetch_row(mysql_query("SELECT COUNT(`category_id`) FROM `products_has_product_category` WHERE `category_id`=" . $row['product_category_id'] . ""));
echo $number[0];
'</span></li>';
}
?>
将不胜感激任何帮助!