none
problema com row_number sql server 2000 RRS feed

  • Pergunta

  • <?php
    session_start();
    
    include("../common/auth.php");
    include("../common/func.php");
    include('../common/config.php');
    
    $userLogin = $user->getLogin(); 
    
    if(!$user->auth($admin_rights)){
    	header("Location: login.php?redirect_to=mall_items.php");
    	die;
    }
    
    require('../db/db_config.php');
    $link = mssql_connect($database['db_host'],$database['db_login'],$database['db_password'],true) or die(mssql_get_last_message());
    mssql_select_db($database['db_name'], $link) or die("Database unavailable");
    
    $query = "select * from [Items]";
    $total_rows = mssql_num_rows(mssql_query($query, $link));
    
    $main_file = 'mall_items';
    include("../common/links.php");
    
    $query = "SELECT *
    FROM (SELECT ROW_NUMBER() OVER (ORDER BY Items.item_order ASC) AS Row, * FROM Items) AS A WHERE A.Row >= $select_from AND A.Row <= $select_to";
    $item_list= mssql_query($query );
    
    $current_category_name = "mall";
    $current_page_name = "manage";
    $content_template="mall_items.php";
    
    $brumble = '<a href="index.php">Home</a> // Manage Items';
    $brumble_link = "<a href='mall_itemedit.php'><img src='img/add.png' alt='add' />Add item</a>";
    
    require_once('../common/site_options.php');
    include("../admin/templates/$site_template/index.php");
    
    mssql_close($link); 
    ?>


    domingo, 13 de janeiro de 2013 17:43

Respostas

Todas as Respostas