I need some help please...(or I kill the cat!)
| From: | Luc Saint-Elie | Date: | Tue, 05 Jun 2001 19:01:16 +0000 |
| Subject: | I need some help please...(or I kill the cat!) | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-864@lists.php.net to get a copy of this message | ||
Hello every body,
OK I suppose that the answer to my question is something obvious but....
I failed to loop through the following array :
// Returns:
// 0 - error (prints error to output)
// array results -
// This is a multi-dimensional array containing various information
// of the poll identified with $poll_id.
// The first element of the array ($result[0]) contains the topic of
// the poll and the number of total votes:
// $result[0]["title"] - topic of the poll
// $result[0]["votes"] - total number of votes for this poll
// The next elemts contain information about the individual poll
// options. If a poll has two options, it would contain two more elements -
// $results[1] and $results[2] - both being an array again with the following
// elements:
// $result[n]["text"] - text of the option
// $result[n]["votes"] - votes for this option
This is an array from phpPolls
a print_r of the array gives :
------------------
Array
(
[0] => Array
(
[title] => Title of the poll
[votes] => Number of answers
)
[1] => Array
(
[text] => Text of option #1
[votes] => number of vote of option #1
)
[2] => Array
(
[text] => Text of option # 2
[votes] => number of vote of option # 2
)
[3] => Array
(
[text] => Text of option # 3
[votes] =>number of vote of option # 3
)
[4] => Array
(
[text] => Text of option # 4
[votes] => number of vote of option # 4
)
[5] => Array
(
[text] => Text of option #5
[votes] => number of vote of option # 5
)
)
----------------------
The result might be :
$result[0]["votes"] people voted for $result[0]["title"]
--------
$result[1]["text"] : $result[1]["votes"] votes
[...]
$result[n]["text"] : $result[n]["votes"] votes
Thanks in advance
Luc