Changeset 453 for branches/beta/inc


Ignore:
Timestamp:
Mar 1, 2009, 2:32:06 PM (16 years ago)
Author:
amun
Message:

Stránkování novinek... (pokus č.3)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/beta/inc/html.php

    r452 r453  
    218218          $where = "WHERE `category` = '".$kategorie."'";
    219219        }
    220         $this -> db -> select_db($db_webu);
    221         $sql = $this -> db -> query("SELECT SQL_CALC_FOUND_ROWS * FROM articles ".$where." ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . intval($_GET["offset"]);
    222         if ($sql -> num_rows > 0)
     220 mysql_connect($db_server, $db_user, $db_pass);
     221  mysql_select_db($db_webu);
     222  $limit = 5;
     223     
     224        $sql = mysql_query("SELECT SQL_CALC_FOUND_ROWS * FROM articles ".$where." ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . intval($_GET["offset"]);
     225                $sql_pocet = mysql_query(mysql_num_rows("SELECT date FROM articles ".$where.);
     226        if ($sql_pocet > 0)
    223227        {
    224228        // TODO !!
    225229               
    226   while ($row = $sql -> fetch_array())
     230  while ($row = mysql_fetch_array($sql))
    227231          {
    228232            switch ($row["category"])
     
    269273          }
    270274                 
    271 mysql_connect($db_server, $db_user, $db_pass);
    272   mysql_select_db($db_webu);
    273   $limit = 5;
     275
    274276$pocet = mysql_result(mysql_query(" SELECT FOUND_ROWS()"), 0);
    275277if ($_GET["offset"]) {
Note: See TracChangeset for help on using the changeset viewer.