我有以下MySQL的输出。
Array
(
[0] => stdClass Object
(
[id] => 19
[date] => 2010-10-04 11:00:00
[course] => Yoga
[course_id] => 19
[count(*)] => 2
[capacity] => 20
)
[1] => stdClass Object
(
[id] => 20
[date] => 2010-10-04 13:00:00
[course] => Spin
[course_id] => 20
[count(*)] => 1
[capacity] => 24
)
...
...
我可以获取日期、课程等,但我不知道如何使用PHP获取count(*)。
foreach ($bookingnum as $key => $list){
echo "<tr valign= top >
";
echo "<td align= center >".$list->date."</td>
";
echo "<td align= center >".$list->course."</td>
";
// echo "<td align= center >".$list->count(*)."</td>
";
// this is wrong. how to get count(*)??
....
...