Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to remove totalRows from link browser ,i dont want to sombody can see how meny rows i have,imm working with dreamweaver and the code was auto generated by recordset.please sombody can help me with this?Tnks and here is my code...



PHP
<?php require_once('Connections/filmconnexion.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"];

    $maxRows_DataCategoria = 12;
$pagina = 0;
if (isset($_GET['pagina'])) {
  $pagina = $_GET['pagina'];
}
$startRow_DataCategoria = $pagina * $maxRows_DataCategoria;

$varCategoria_DataCategoria = "0";
if (isset($_GET["cat"])) {
  $varCategoria_DataCategoria = $_GET["cat"];
}
mysql_select_db($database_filmconnexion, $filmconnexion);
$query_DataCategoria = sprintf("SELECT * FROM tbl_film WHERE tbl_film.intCategoria = %s ", GetSQLValueString($varCategoria_DataCategoria, "int"));
$query_limit_DataCategoria = sprintf("%s LIMIT %d, %d", $query_DataCategoria, $startRow_DataCategoria, $maxRows_DataCategoria);
$DataCategoria = mysql_query($query_limit_DataCategoria, $filmconnexion) or die(mysql_error());
$row_DataCategoria = mysql_fetch_assoc($DataCategoria);

if (isset($_GET['totalRows_DataCategoria'])) {
  $totalRows_DataCategoria = $_GET['totalRows_DataCategoria'];
} else {
  $all_DataCategoria = mysql_query($query_DataCategoria);
  $totalRows_DataCategoria = mysql_num_rows($all_DataCategoria);
}
$totalPages_DataCategoria = ceil($totalRows_DataCategoria/$maxRows_DataCategoria)-1;

$queryString_DataCategoria = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pagina") == false && 
        stristr($param, "totalRows_DataCategoria") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_DataCategoria = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_DataCategoria = sprintf("&totalRows_DataCategoria=%d%s", $totalRows_DataCategoria, $queryString_DataCategoria);
    ?>




<div class="rezultfilm">
          <?php if ($totalRows_DataCategoria ?> 0) { // Show if recordset not empty ?>
  <?php do { ??>
    <div class="Filminitaliano"><a href="filminstreamingitalia.php?recordID=<?php echo $row_DataCategoria['id']; ?>"><img src="Imag/Cop/<?php echo $row_DataCategoria['imagine']; ??>" width="160" height="190" alt="filminitaliano.com|Film gratis in italiano|Italia Streaming Online Gratis"></a>
      <p><?php echo $row_DataCategoria['nome']; ??></p></div>
      <?php } while ($row_DataCategoria = mysql_fetch_assoc($DataCategoria)); ??>

            <?php } // Show if recordset not empty ??>
            <?php if ($totalRows_DataCategoria == 0) { // Show if recordset empty ??>
              Per questo momento non essiste nessun film in questa categoria!
  <?php } // Show if recordset empty ??>
  </div>
  ....................................
  <div>
    <table border="0">
      <tr>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(">">Prima pagina</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(" -="">">Preccedente</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Prossima</a>
            <?php } // Show if not last page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Ultima</a>
            <?php } // Show if not last page ??></td>
      </tr>
    </table>
  </div><div class="rezultfilm">
          <?php if ($totalRows_DataCategoria ?> 0) { // Show if recordset not empty ?>
  <?php do { ??>
    <div class="Filminitaliano"><a href="filminstreamingitalia.php?recordID=<?php echo $row_DataCategoria['id']; ?>"><img src="Imag/Cop/<?php echo $row_DataCategoria['imagine']; ??>" width="160" height="190" alt="filminitaliano.com|Film gratis in italiano|Italia Streaming Online Gratis"></a>
      <p><?php echo $row_DataCategoria['nome']; ??></p></div>
      <?php } while ($row_DataCategoria = mysql_fetch_assoc($DataCategoria)); ??>

            <?php } // Show if recordset not empty ??>
            <?php if ($totalRows_DataCategoria == 0) { // Show if recordset empty ??>
              Per questo momento non essiste nessun film in questa categoria!
  <?php } // Show if recordset empty ??>
  </div>
  ....................................
  <div>
    <table border="0">
      <tr>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(">">Prima pagina</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina ?> 0) { // Show if not first page ?>
            <a href="<?php printf(" -="">">Preccedente</a>
            <?php } // Show if not first page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Prossima</a>
            <?php } // Show if not last page ??></td>
        <td><?php if ($pagina < $totalPages_DataCategoria) { // Show if not last page ??>
            <a href="<?php printf(">">Ultima</a>
            <?php } // Show if not last page ??></td>
      </tr>
    </table>
  </div>


mysql_free_result($DataCategoria);
?>
Posted
Updated 15-Jan-13 2:58am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900