Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095

Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095

Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095

Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095

Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095

Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095

Warning: Invalid argument supplied for foreach() in /srv/sleepycode.com/public_html/forum/Sources/Subs-Editor.php on line 2095
Paste-1324606230:v:use_geshi-0:v:type-php
 

Paste-1324606230:v:use_geshi-0:v:type-php

Started by Guest, Dec 23, 2011, 02:10 am

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Guest

$array1 = array(1,2,3,4,5,6,7)

$choices = "1,3,5,2,3,4,3,2,7,4,2,1,4,5,3,4,2,1,3,3";

item "1" in array one appeared in $choices 2 times
item "2" in array one appeared in $choices 4 times
item "3" in array one appeared in $choices 6 times
item "4" in array one appeared in $choices 3 times
item "5" in array one appeared in $choices 2 times
item "6" in array one appeared in $choices 0 times
item "7" in array one appeared in $choices 1 times

Then print the results as follows:

Item "1": 2 - 11%
Item "2": 4 - 22%
Item "3": 6 - 33%
Item "4": 3 - 16%
Item "5": 2 - 11%
Item "7": 1 - 6%

Notice that Item "6" is not in the display, since it has no votes/selections

asdfasdf

$array1 = array(1,2,3,4,5,6,7)

$choices = "1,3,5,2,3,4,3,2,7,4,2,1,4,5,3,4,2,1,3,3";

item "1" in array one appeared in $choices 2 times
item "2" in array one appeared in $choices 4 times
item "3" in array one appeared in $choices 6 times
item "4" in array one appeared in $choices 3 times
item "5" in array one appeared in $choices 2 times
item "6" in array one appeared in $choices 0 times
item "7" in array one appeared in $choices 1 times

Then print the results as follows:

Item "1": 2 - 11%
Item "2": 4 - 22%
Item "3": 6 - 33%
Item "4": 3 - 16%
Item "5": 2 - 11%
Item "7": 1 - 6%

Notice that Item "6" is not in the display, since it has no votes/selections

--------------------------------------
$mstrreas1=mysql_query("
   SELECT id, reason
   FROM CONFIG_cxreasons
   ");

while($mstrreastmp1=mysql_fetch_array($mstrreas1)){
   list($mid,$mreason)=$mstrreastmp1;
   foreach($reasonlist as $key=>$indreason){
      if($mreason=="$indreason"){
      $mreason$mid++;$reasontotal++;
   }
}

 
Browser ID: smf ()
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 2: index+Modifications.english (default), Post.english (default).
Style sheets: 3: index.css, responsive.css, jquery.sceditor.css.
Hooks called: 39 (show)
Files included: 30 - 1045KB. (show)
Memory used: 1559KB.
Tokens: post-login, post-register.
Queries used: 21.

[Show Queries]