All pastes #447079 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-18 20:34 UTC
rendered paste body
<?php 	
$list = array ("N" , "F" , "P" , "O" ,"R"); 
   
//   foreach($list as $value)	{
	//comparison of the database type with the array list
	
	$typeCount = 0;

 
    while($rows = mysql_fetch_assoc($result))
   	{ 
	//start of the main loop through the database
/*	print "<pre>";
	print_r($rows); 
	print "</pre>";*/
	 //comparison of the database type with the array list
	 
	  
		  
			   if($rows['TYPE'] == "N" || $rows['TYPE'] == "F" || $rows['TYPE'] == "P" || $rows['TYPE'] == "O" || $rows['TYPE'] == "R")
			   {
			   $value = $rows['TYPE'];
			   $typeCount = 1;
			   }
		  
	   	
			if($typeCount == 1)
				{
					$storyType = "NEWS";
					if($value == "B") $storyType = "NEWS BRIEFS";
	   				if($value == "F") $storyType = "FEATURES";
					if($value == "P") $storyType = "PROFILES";
					if($value == "R") $storyType = "REVIEWS";
					if($value == "O") $storyType = "OBITUARIES";
				 
}

if($type!=$rows['TYPE']){
print $storyType;
 $type=$rows['TYPE'];
}