Fóruns sobre PHP, JavaScript, HTML, MySQLi, jQuery, Banco de Dados, CSS


Moderador: web

 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 285

Listagem por ordem alfabética

07-08-2012 09:00

OLá amigos preciso de uma ajuda urgente.
estou com uma listagem onde exibe resultados referentes a parametros buscados pelo pais,região,produtor e nome.
necessariamente preciso que quando os mesmos listados na pagina sejam exibidos por ordem alfabética mas somente através do produtor já que a exibição também lista o nome,região,produtor e o pais.
veja a exibição nesse link:
http://www.vinissimo.com.br/listagem.php?pais=Franca

preciso que esses rotulo venham em ordem alfabética mas referente ao produtor(segunda linha dem cima para baixo)
segue o código:

<?php require_once('Connections/vinissimo1.php'); ?> <?php // Load the tNG classes require_once('includes/tng/tNG.inc.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")  {   if (PHP_VERSION < 6) {     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;   }   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);   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; } } $currentPage = $_SERVER["PHP_SELF"]; if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")  {   if (PHP_VERSION < 6) {     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;   }   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);   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; } } $maxRows_Recordset1 = 20; $pageNum_Recordset1 = 0; if (isset($_GET['pageNum_Recordset1'])) {   $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $colname_Recordset1 = "-1"; if (isset($_GET['pais'])) {   $colname_Recordset1 = $_GET['pais']; } mysql_select_db($database_vinissimo1, $vinissimo1); $query_Recordset1 = sprintf("SELECT * FROM vinissimo_bancodedados WHERE pais = $pais", GetSQLValueString($colname_Recordset1, "text")); $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $vinissimo1) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); if (isset($_GET['totalRows_Recordset1'])) {   $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else {   $all_Recordset1 = mysql_query($query_Recordset1);   $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); } $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; $maxRows_Recordset2 = 20; $pageNum_Recordset2 = 0; if (isset($_GET['pageNum_Recordset2'])) {   $pageNum_Recordset2 = $_GET['pageNum_Recordset2']; } $startRow_Recordset2 = $pageNum_Recordset2 * $maxRows_Recordset2; $colname_Recordset2 = "-1"; if (isset($_GET['regiao'])) {   $colname_Recordset2 = $_GET['regiao']; } mysql_select_db($database_vinissimo1, $vinissimo1); $query_Recordset2 = sprintf("SELECT * FROM vinissimo_bancodedados WHERE regiao = %s ORDER BY id ASC", GetSQLValueString($colname_Recordset2, "text")); $query_limit_Recordset2 = sprintf("%s LIMIT %d, %d", $query_Recordset2, $startRow_Recordset2, $maxRows_Recordset2); $Recordset2 = mysql_query($query_limit_Recordset2, $vinissimo1) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); if (isset($_GET['totalRows_Recordset2'])) {   $totalRows_Recordset2 = $_GET['totalRows_Recordset2']; } else {   $all_Recordset2 = mysql_query($query_Recordset2);   $totalRows_Recordset2 = mysql_num_rows($all_Recordset2); } $totalPages_Recordset2 = ceil($totalRows_Recordset2/$maxRows_Recordset2)-1; $maxRows_Recordset3 = 20; $pageNum_Recordset3 = 0; if (isset($_GET['pageNum_Recordset3'])) {   $pageNum_Recordset3 = $_GET['pageNum_Recordset3']; } $startRow_Recordset3 = $pageNum_Recordset3 * $maxRows_Recordset3; $colname_Recordset3 = "-1"; if (isset($_GET['produtor'])) {   $colname_Recordset3 = $_GET['produtor']; } mysql_select_db($database_vinissimo1, $vinissimo1); $query_Recordset3 = sprintf("SELECT * FROM vinissimo_bancodedados WHERE produtor = %s ORDER BY id ASC", GetSQLValueString($colname_Recordset3, "text")); $query_limit_Recordset3 = sprintf("%s LIMIT %d, %d", $query_Recordset3, $startRow_Recordset3, $maxRows_Recordset3); $Recordset3 = mysql_query($query_limit_Recordset3, $vinissimo1) or die(mysql_error()); $row_Recordset3 = mysql_fetch_assoc($Recordset3); if (isset($_GET['totalRows_Recordset3'])) {   $totalRows_Recordset3 = $_GET['totalRows_Recordset3']; } else {   $all_Recordset3 = mysql_query($query_Recordset3);   $totalRows_Recordset3 = mysql_num_rows($all_Recordset3); } $totalPages_Recordset3 = ceil($totalRows_Recordset3/$maxRows_Recordset3)-1; $maxRows_tipo = 20; $pageNum_tipo = 0; if (isset($_GET['pageNum_tipo'])) {   $pageNum_tipo = $_GET['pageNum_tipo']; } $startRow_tipo = $pageNum_tipo * $maxRows_tipo; $colname_tipo = "-1"; if (isset($_GET['tipo'])) {   $colname_tipo = $_GET['tipo']; } mysql_select_db($database_vinissimo1, $vinissimo1); $query_tipo = sprintf("SELECT * FROM vinissimo_bancodedados WHERE tipo = %s ORDER BY id ASC", GetSQLValueString($colname_tipo, "text")); $query_limit_tipo = sprintf("%s LIMIT %d, %d", $query_tipo, $startRow_tipo, $maxRows_tipo); $tipo = mysql_query($query_limit_tipo, $vinissimo1) or die(mysql_error()); $row_tipo = mysql_fetch_assoc($tipo); if (isset($_GET['totalRows_tipo'])) {   $totalRows_tipo = $_GET['totalRows_tipo']; } else {   $all_tipo = mysql_query($query_tipo);   $totalRows_tipo = mysql_num_rows($all_tipo); } $totalPages_tipo = ceil($totalRows_tipo/$maxRows_tipo)-1; $colname_uva = "-1"; if (isset($_GET['uva'])) {   $colname_uva = $_GET['uva']; } mysql_select_db($database_vinissimo1, $vinissimo1); $query_uva = sprintf("SELECT * FROM vinissimo_bancodedados WHERE uva = %s ORDER BY id ASC", GetSQLValueString($colname_uva, "text")); $uva = mysql_query($query_uva, $vinissimo1) or die(mysql_error()); $row_uva = mysql_fetch_assoc($uva); $totalRows_uva = mysql_num_rows($uva); $queryString_Recordset1 = ""; if (!empty($_SERVER['QUERY_STRING'])) {   $params = explode("&", $_SERVER['QUERY_STRING']);   $newParams = array();   foreach ($params as $param) {     if (stristr($param, "pageNum_Recordset1") == false &&          stristr($param, "totalRows_Recordset1") == false) {       array_push($newParams, $param);     }   }   if (count($newParams) != 0) {     $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));   } } $queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); $queryString_Recordset2 = ""; if (!empty($_SERVER['QUERY_STRING'])) {   $params = explode("&", $_SERVER['QUERY_STRING']);   $newParams = array();   foreach ($params as $param) {     if (stristr($param, "pageNum_Recordset2") == false &&          stristr($param, "totalRows_Recordset2") == false) {       array_push($newParams, $param);     }   }   if (count($newParams) != 0) {     $queryString_Recordset2 = "&" . htmlentities(implode("&", $newParams));   } } $queryString_Recordset2 = sprintf("&totalRows_Recordset2=%d%s", $totalRows_Recordset2, $queryString_Recordset2); $queryString_Recordset3 = ""; if (!empty($_SERVER['QUERY_STRING'])) {   $params = explode("&", $_SERVER['QUERY_STRING']);   $newParams = array();   foreach ($params as $param) {     if (stristr($param, "pageNum_Recordset3") == false &&          stristr($param, "totalRows_Recordset3") == false) {       array_push($newParams, $param);     }   }   if (count($newParams) != 0) {     $queryString_Recordset3 = "&" . htmlentities(implode("&", $newParams));   } } $queryString_tipo = sprintf("&totalRows_tipo=%d%s", $totalRows_tipo, $queryString_tipo); $queryString_tipo = ""; if (!empty($_SERVER['QUERY_STRING'])) {   $params = explode("&", $_SERVER['QUERY_STRING']);   $newParams = array();   foreach ($params as $param) {     if (stristr($param, "pageNum_tipo") == false &&          stristr($param, "totalRows_tipo") == false) {       array_push($newParams, $param);     }   }   if (count($newParams) != 0) {     $queryString_tipo = "&" . htmlentities(implode("&", $newParams));   } } $queryString_tipo = sprintf("&totalRows_tipo=%d%s", $totalRows_tipo, $queryString_tipo);    $queryString_uva = sprintf("&totalRows_uva=%d%s", $totalRows_uva, $queryString_uva); $queryString_uva = ""; if (!empty($_SERVER['QUERY_STRING'])) {   $params = explode("&", $_SERVER['QUERY_STRING']);   $newParams = array();   foreach ($params as $param) {     if (stristr($param, "pageNum_uva") == false &&          stristr($param, "totalRows_uva") == false) {       array_push($newParams, $param);     }   }   if (count($newParams) != 0) {     $queryString_uva = "&" . htmlentities(implode("&", $newParams));   } } $queryString_uva = sprintf("&totalRows_uva=%d%s", $totalRows_uva, $queryString_uva); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>VINISSIMO. SEU PRAZER, NOSSA PAIX&Atilde;O.</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <link href="http://vinissimo.com.br/css/global.css" rel="stylesheet" type="text/css" /> <link href="http://vinissimo.com.br/css/banner_home.css" rel="stylesheet" type="text/css">          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>     <script src="http://vinissimo.com.br/js/slides.min.jquery.js"></script> </head> <body> <!-- /INICIO HEADER -->     <div id="header">     <div id="header-inner">         <?php include 'header.php'; ?>          </div>     </div>      <!-- /FIM HEADER --> <!-- /INICIO CONTEÚDO -->     <div id="wrap">     <div id="wrap-inner">         <div id="content">             <div id="left_col_230">                                  <?php include 'menu_esquerdo.php'; ?>                          </div>                                       <div id="col_750">             <div id="col_750-inner">                                      <div class="titulo_vinho_18px"><span class="vinho_18px">OS VINHOS MAIS COMENTADOS</span></div>                 <div class="titulo_rosa_13px"><span class="rosa_13px">Clique sobre a imagem e conheça mais</span></div>                                  </div>             <div id="col_conteudo_geral_750">                                                                                   <!-- PAÍS -->                                      <?php if(isset($_GET['pais'])) { ?>                                  <table width="730" cellpadding="0" cellspacing="0">                   <tr>                   <?php do { ?> <td align="center">                                        <table width="175" cellpadding="0" cellspacing="0" align="center">                     <tr><td align="center" style="text-align:center;"><a href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset1['id']; ?>"><img style="padding-bottom:12px;" src="<?php echo tNG_showDynamicImage("../", "vini_adm/img_wine/", "{Recordset1.imagem}");?>" width="60" height="120" border="0" /></a></td></tr>                     <tr><td align="center" style="text-align:center;"><a class="preto_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset1['id']; ?>"><?php echo $row_Recordset1['rotulo']; ?></a></td></tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset1['produtor']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset1['regiao']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset1['pais']; ?></td>                     </tr>                     <tr><td align="center" style="text-align:center;"><a class="cinza_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset1['id']; ?>">saiba mais</a></td></tr>                       </table>                                            </td>                                                     <?php                                              $row_Recordset1 = mysql_fetch_assoc($Recordset1);                       if(!isset($nested_Recordset1))                            {                              $nested_Recordset1 = 1;                             }                       if(isset($row_Recordset1) && is_array($row_Recordset1) && $nested_Recordset1++%4==0)                            {                         echo "</tr><tr><td height=30>&nbsp;</td><tr>";                            }                          } while ($row_Recordset1);                           ?>                     </tr>                 </table>                      <p>&nbsp;</p>                   <p>&nbsp;</p>                      <table border="0">                 <tr>                                  <td>                   <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">Primeira</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Anterior</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Próxma</a>                  <?php } // Show if not last page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>                  <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Última</a>                   <?php } // Show if not last page ?></td>                 </tr>                   </table>                                                         <p>&nbsp;</p>                 <p>&nbsp;</p>                                      <?php }?>                                <!-- REGIÃO -->                                   <?php if(isset($_GET['regiao'])) { ?>                                  <table width="730" cellpadding="0" cellspacing="0">                   <tr>                   <?php do { ?> <td align="center">                                        <table width="175" cellpadding="0" cellspacing="0" align="center">                     <tr><td align="center" style="text-align:center;"><a href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset2['id']; ?>"><img style="padding-bottom:12px;" src="<?php echo tNG_showDynamicImage("../", "vini_adm/img_wine/", "{Recordset2.imagem}");?>" width="60" height="120" border="0" /></a></td></tr>                     <tr><td align="center" style="text-align:center;"><a class="preto_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset2['id']; ?>"><?php echo $row_Recordset2['rotulo']; ?></a></td></tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset2['produtor']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset2['regiao']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset2['pais']; ?></td>                     </tr>                     <tr><td align="center" style="text-align:center;"><a class="cinza_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset2['id']; ?>">saiba mais</a></td></tr>                       </table>                                            </td>                                                     <?php                                              $row_Recordset2 = mysql_fetch_assoc($Recordset2);                       if(!isset($nested_Recordset2))                            {                              $nested_Recordset2 = 1;                             }                       if(isset($row_Recordset2) && is_array($row_Recordset2) && $nested_Recordset2++%4==0)                            {                         echo "</tr><tr><td height=30>&nbsp;</td><tr>";                            }                          } while ($row_Recordset2);                           ?>                     </tr>                 </table>                     <p>&nbsp;</p>                   <p>&nbsp;</p>                      <table border="0">                 <tr>                                  <td>                   <?php if ($pageNum_Recordset2 > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset2=%d%s", $currentPage, 0, $queryString_Recordset2); ?>">Primeira</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset2 > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset2=%d%s", $currentPage, max(0, $pageNum_Recordset2 - 1), $queryString_Recordset2); ?>">Anterior</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset2 < $totalPages_Recordset2) { // Show if not last page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset2=%d%s", $currentPage, min($totalPages_Recordset2, $pageNum_Recordset2 + 1), $queryString_Recordset2); ?>">Próxima</a>                  <?php } // Show if not last page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset2 < $totalPages_Recordset2) { // Show if not last page ?>                  <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset2=%d%s", $currentPage, $totalPages_Recordset2, $queryString_Recordset2); ?>">ùltima</a>                   <?php } // Show if not last page ?></td>                 </tr>                   </table>                                                         <p>&nbsp;</p>                 <p>&nbsp;</p>                                      <?php }?>                                  <!-- PRODUTOR -->                                   <?php if(isset($_GET['produtor'])) { ?>                                  <table width="730" cellpadding="0" cellspacing="0">                   <tr>                   <?php do { ?> <td align="center">                                        <table width="175" cellpadding="0" cellspacing="0" align="center">                     <tr><td align="center" style="text-align:center;"><a href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset3['id']; ?>"><img style="padding-bottom:12px;" src="<?php echo tNG_showDynamicImage("../", "vini_adm/img_wine/", "{Recordset3.imagem}");?>" width="60" height="120" border="0" /></a></td></tr>                     <tr><td align="center" style="text-align:center;"><a class="preto_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset3['id']; ?>"><?php echo $row_Recordset3['rotulo']; ?></a></td></tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset3['produtor']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset3['regiao']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_Recordset3['pais']; ?></td>                     </tr>                     <tr><td align="center" style="text-align:center;"><a class="cinza_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_Recordset3['id']; ?>">saiba mais</a></td></tr>                       </table>                                            </td>                                                     <?php                                              $row_Recordset3 = mysql_fetch_assoc($Recordset3);                       if(!isset($nested_Recordset3))                            {                              $nested_Recordset3 = 1;                             }                       if(isset($row_Recordset3) && is_array($row_Recordset3) && $nested_Recordset3++%4==0)                            {                         echo "</tr><tr><td height=30>&nbsp;</td><tr>";                            }                          } while ($row_Recordset3);                           ?>                     </tr>                 </table>                     <p>&nbsp;</p>                   <p>&nbsp;</p>                      <table border="0">                 <tr>                                  <td>                   <?php if ($pageNum_Recordset3 > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset3=%d%s", $currentPage, 0, $queryString_Recordset3); ?>">Primeira</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset3 > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset3=%d%s", $currentPage, max(0, $pageNum_Recordset3 - 1), $queryString_Recordset3); ?>">Anterior</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset3 < $totalPages_Recordset3) { // Show if not last page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset3=%d%s", $currentPage, min($totalPages_Recordset3, $pageNum_Recordset3 + 1), $queryString_Recordset3); ?>">Próxima</a>                  <?php } // Show if not last page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_Recordset3 < $totalPages_Recordset3) { // Show if not last page ?>                  <a class="cinza_12px" href="<?php printf("%s?pageNum_Recordset3=%d%s", $currentPage, $totalPages_Recordset3, $queryString_Recordset3); ?>">Última</a>                   <?php } // Show if not last page ?></td>                 </tr>                   </table>                                                         <p>&nbsp;</p>                 <p>&nbsp;</p>                                      <?php }?>                                                                             <!--tipo-->                                                     <?php if(isset($_GET['tipo'])) { ?>                                  <table width="730" cellpadding="0" cellspacing="0">                   <tr>                   <?php do { ?> <td align="center">                                        <table width="175" cellpadding="0" cellspacing="0" align="center">                     <tr><td align="center" style="text-align:center;"><a href="rotulo_destaque.php?rotulo=<?php echo $row_tipo['id']; ?>"><img style="padding-bottom:12px;" src="<?php echo tNG_showDynamicImage("../", "vini_adm/img_wine/", "{tipo.imagem}");?>" width="60" height="120" border="0" /></a></td></tr>                     <tr><td align="center" style="text-align:center;"><a class="preto_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_tipo['id']; ?>"><?php echo $row_tipo['rotulo']; ?></a></td></tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_tipo['produtor']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_tipo['regiao']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_tipo['pais']; ?></td>                     </tr>                     <tr><td align="center" style="text-align:center;"><a class="cinza_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_tipo['id']; ?>">saiba mais</a></td></tr>                       </table>                                            </td>                                                     <?php                                              $row_tipo = mysql_fetch_assoc($tipo);                       if(!isset($nested_tipo))                            {                              $nested_tipo = 1;                             }                       if(isset($row_tipo) && is_array($row_tipo) && $nested_tipo++%4==0)                            {                         echo "</tr><tr><td height=30>&nbsp;</td><tr>";                            }                          } while ($row_tipo);                           ?>                     </tr>                 </table>                     <p>&nbsp;</p>                   <p>&nbsp;</p>                      <table border="0">                 <tr>                                  <td>                   <?php if ($pageNum_tipo > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_tipo=%d%s", $currentPage, 0, $queryString_tipo); ?>">Primeira</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_tipo > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_tipo=%d%s", $currentPage, max(0, $pageNum_tipo - 1), $queryString_tipo); ?>">Anterior</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_tipo < $totalPages_tipo) { // Show if not last page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_tipo=%d%s", $currentPage, min($totalPages_tipo, $pageNum_tipo + 1), $queryString_tipo); ?>">Próxima</a>                  <?php } // Show if not last page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_tipo < $totalPages_tipo) { // Show if not last page ?>                  <a class="cinza_12px" href="<?php printf("%s?pageNum_tipo=%d%s", $currentPage, $totalPages_tipo, $queryString_tipo); ?>">Última</a>                   <?php } // Show if not last page ?></td>                 </tr>                   </table>                                                         <p>&nbsp;</p>                 <p>&nbsp;</p>                                      <?php }?>                                                             <!--uva-->                                                                                             <?php if(isset($_GET['uva'])) { ?>                 <table width="730" cellpadding="0" cellspacing="0">                   <tr>                   <?php do { ?> <td align="center">                                        <table width="175" cellpadding="0" cellspacing="0" align="center">                     <tr><td align="center" style="text-align:center;"><a href="rotulo_destaque.php?rotulo=<?php echo $row_uva['id']; ?>"><img style="padding-bottom:12px;" src="<?php echo tNG_showDynamicImage("../", "vini_adm/img_wine/", "{uva.imagem}");?>" width="60" height="120" border="0" /></a></td></tr>                     <tr><td align="center" style="text-align:center;"><a class="preto_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_uva['id']; ?>"><?php echo $row_uva['rotulo']; ?></a></td></tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_uva['produtor']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_uva['regiao']; ?></td>                     </tr>                     <tr>                       <td align="center" class="preto_12px" style="text-align:center;"><?php echo $row_uva['pais']; ?></td>                     </tr>                     <tr><td align="center" style="text-align:center;"><a class="cinza_12px" href="rotulo_destaque.php?rotulo=<?php echo $row_uva['id']; ?>">saiba mais</a></td></tr>                       </table>                                            </td>                                                     <?php                                              $row_uva = mysql_fetch_assoc($uva);                       if(!isset($nested_uva))                            {                              $nested_uva = 1;                             }                       if(isset($row_uva) && is_array($row_uva) && $nested_uva++%4==0)                            {                         echo "</tr><tr><td height=30>&nbsp;</td><tr>";                            }                          } while ($row_uva);                           ?>                     </tr>                 </table>                     <p>&nbsp;</p>                   <p>&nbsp;</p>                      <table border="0">                 <tr>                                  <td>                   <?php if ($pageNum_uva > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_uva=%d%s", $currentPage, 0, $queryString_uva); ?>">Primeira</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_uva > 0) { // Show if not first page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_uva=%d%s", $currentPage, max(0, $pageNum_uva - 1), $queryString_uva); ?>">Anterior</a>                   <?php } // Show if not first page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_uva < $totalPages_uva) { // Show if not last page ?>                   <a class="cinza_12px" href="<?php printf("%s?pageNum_uva=%d%s", $currentPage, min($totalPages_uva, $pageNum_uva + 1), $queryString_uva); ?>">Próximo</a>                  <?php } // Show if not last page ?></td>                   <td>&nbsp;</td>                   <td><?php if ($pageNum_tipo < $totalPages_uva) { // Show if not last page ?>                  <a class="cinza_12px" href="<?php printf("%s?pageNum_uva=%d%s", $currentPage, $totalPages_uva, $queryString_uva); ?>">Últimat</a>                   <?php } // Show if not last page ?></td>                 </tr>                   </table>                                      <?php }?>                         <p>&nbsp;</p>                 <p>&nbsp;</p>               </div>                              </div>                      </div> <!-- /content -->     <!-- /FIM CONTEÚDO --> <!-- /INICIO RODAPÉ -->         <div id="footer">         <div id="footer-inner">             <?php include 'footer.php'; ?>              </div>         </div>                   </div> <!-- /wrap-inner -->     </div> <!-- /wrap --> <!-- /FIM RODAPÉ --> </body> </html> <?php mysql_free_result($Recordset1); mysql_free_result($Recordset2); mysql_free_result($Recordset3); mysql_free_result($tipo); mysql_free_result($uva); ?>

0
 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 285

Listagem por ordem alfabética

07-08-2012 11:31

resolvi o que queria seria:

ORDER BY produtor ASC

mas eu queria também ordenar mais um campo ou seja:

ORDER BY produtor,rotulo ASC

seria isso?

coloquei e não está funcionado, alguém pode me auxiliar?
0
 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 285

Listagem por ordem alfabética

07-08-2012 13:15

resolvido!! obrigado !
segue o codigo:

mysql_select_db($database_vinissimo1, $vinissimo1); $query_Recordset1 = sprintf("SELECT DISTINCT vinissimo_bancodedados.id, vinissimo_bancodedados.pais, vinissimo_bancodedados.regiao, vinissimo_bancodedados.rotulo, vinissimo_bancodedados.imagem, vinissimo_bancodedados.produtor FROM vinissimo_bancodedados WHERE vinissimo_bancodedados.pais=%s ORDER BY vinissimo_bancodedados.produtor ASC, vinissimo_bancodedados.rotulo ASC " 

:rock:
0

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado