Date: 05/11/07 (PHP Community) Keywords: no keywords Hi all! function determineDownloads($a) { switch ($a) { case "canbus": $bronze = 500; $silver = 1000; $gold = 2000; break; case "canman": $bronze = 2000; $silver = 2000; $gold = 2000; break; case "amman": $bronze = 5000; $silver = 5000; $gold = 5000; break; case "namrep": $bronze = 2000; $silver = 2000; $gold = 2000; break; } echo "Bronze Package downloads: ".$bronze." records<*br>\n"; echo "Silver Package downloads: ".$silver." records<*br>\n"; echo "Gold Package downloads: ".$gold." records\n"; } When I call this function (determineDownloads($user)) all it puts out is: Bronze Package downloads: records Silver Package downloads: records Gold Package downloads: records without the actual record count. The function below works properly and displays the correct information and I can't find or figure out why it works but the above doesn't. That is, the below function gets the correct value for $user but the above doesn't. The value doesn't change and is retrieved when the page is first loaded. It doesn't make sense that one function would get the correct value and another wouldn't. At least not that I can see. Any help would be greatly appreciated. Working function: function determineResults($a) { switch ($a) { case "canbus": $bronzeresults = 500; $silverresults = 500; $goldresults = 500; break; default: $bronzeresults = 500; $silverresults = 1000; $goldresults = 2000; break; } echo "Bronze Package search results: ".$bronzeresults."<*br>\n"; echo "Silver Package search results: ".$silverresults."<*br>\n"; echo "Gold Package search results: ".$goldresults."\n"; } (Please ignore the * in the br tags, for whatever reason it was displaying those as line breaks instead of the actual code)
|