<?php require_once("funcoes.php");

$categoria	=	$_POST['categoria'];

mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET charecter_set_client=utf8');
mysql_query('SET charecter_set_results=utf8');

$select2 = "SELECT * FROM tb_subcategoria WHERE cod_categoria = '$categoria' ORDER BY nome ASC";
$query2	= mysql_query($select2);
if(mysql_num_rows($query2) == 0) {
	
	echo "<option value=''>Tipo</option>";
	
	} else {

		echo "<option value=''>Tipo</option>";
		
		while($sql = mysql_fetch_assoc($query2)){
			
			echo '<option value="'.$sql['cod'].'">'.$sql['nome'].'</option>';
			
			print_r($select);
		}
	}