Всем привет. Подскажите пожалуйста, что в этом куске кода топа отвечает за выборт парамерта захватываемого из базы по которому и будет производиться  сортировка от большего к меньшему? В данном случае - уровень.
	
	
	
		
		
		
	
	
		
	
			
			
		PHP:
	
	  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;  
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
//Pesquisa
if(!(@$_GET['classe'] > ''))$pclasse="";
    elseif(@$_GET['classe'] == 'todas')$pclasse="";
        elseif(@$_GET['classe'] == $_GET['classe'])$pclasse="WHERE classe = '".@$_GET['classe']."'";  
//Fim Pesquisa
$maxRows_chars = 50;
$pageNum_chars = 0;
if (isset($_GET['pageNum_chars'])) {
  $pageNum_chars = $_GET['pageNum_chars'];
}
$startRow_chars = $pageNum_chars * $maxRows_chars;
mysql_select_db($database_wargames, $wargames);
$query_chars = "SELECT * FROM rank ".@$pclasse." ORDER by level DESC, cultivo DESC, matou DESC, morto ASC";
$query_limit_chars = sprintf("%s LIMIT %d, %d", $query_chars, $startRow_chars, $maxRows_chars);
$chars = mysql_query($query_limit_chars, $wargames) or die(mysql_error());
$row_chars = mysql_fetch_assoc($chars);
if (isset($_GET['totalRows_chars'])) {
  $totalRows_chars = $_GET['totalRows_chars'];
} else {
  $all_chars = mysql_query($query_chars);
  $totalRows_chars = mysql_num_rows($all_chars);
}
$totalPages_chars = ceil($totalRows_chars/$maxRows_chars)-1;
mysql_select_db($database_wargames, $wargames);
$query_data = "SELECT * FROM `data`";
$data = mysql_query($query_data, $wargames) or die(mysql_error());
$row_data = mysql_fetch_assoc($data);
$totalRows_data = mysql_num_rows($data);
?>
	
	
			
				Last edited by a moderator: