RE: I need some help please...(or I kill the cat!)
| From: | Luc Saint-Elie | Date: | Tue, 05 Jun 2001 21:50:14 +0000 |
| Subject: | RE: I need some help please...(or I kill the cat!) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-869@lists.php.net to get a copy of this message | ||
Hello Alain
As stupid as it can seem I fail to write the {section} that loop thought this array of arrays ...
Luc
At 21:04 05/06/01 +0200, Alain Fontaine wrote:
Hi, Ok, and where's the exact problem? What don't you get right with that? -----Message d'origine----- De : Luc Saint-Elie [mailto:luc@saint-elie.com] Envoye : mardi 5 juin 2001 21:01 A : smarty@lists.ispi.net Objet : [smarty] I need some help please...(or I kill the cat!) 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 --- You are currently subscribed to smarty as: alain@nvision.lu To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/ --- You are currently subscribed to smarty as: luc@saint-elie.com To unsubscribe send a blank email to $subst('Email.Unsub') Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/