Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:36:29+00:00 2026-06-04T09:36:29+00:00

I need to rewrite pagerquery, i have tried out several options adding tags, extend(PagerDefault)

  • 0

I need to rewrite pagerquery, i have tried out several options adding tags, extend(PagerDefault) but nothing worked for me:
Please help.

My version 6 code is:

$sql = 'SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM {node} n '.$sort_join.' WHERE n.uid = %d AND n.type = "case" AND n.status = 1 ORDER BY '. $order;

$sql_count = ‘SELECT COUNT(DISTINCT(n.nid)) FROM {node} n WHERE n.uid = %d AND n.type = “case” AND n.status = 1’;

$args = array('uid' => $user->uid);

$sql = db_rewrite_sql($sql);

$sql_count = db_rewrite_sql($sql_count);

if ($pager) {

$result = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count, $args);
dsm($result);

}

else {

$result = db_query_range($sql, $args, 0, variable_get('feed_default_items', 10));
}


$num_rows = FALSE;
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load($node->nid), 1);
$num_rows = TRUE;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:36:30+00:00Added an answer on June 4, 2026 at 9:36 am

    Without knowing the name of your join table this isn’t complete, but should get you started:

    $query = db_select('node', 'n')
      ->fields('n', array('nid', 'sticky', 'title', 'created'))
      ->condition('n.uid', $user->uid)
      ->condition('n.type', 'case')
      ->condition('n.status', 1)
      ->extend('PagerDefault')
      ->limit(variable_get('default_nodes_main', 10))
      ->addTag('node_access')
      ->orderBy('col_name');
    
    $query->join('table_to_join', 'table_alias', 'table_alias.nid = n.nid');
    
    foreach ($query->execute() as $row) {
      // Do what you need to
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a mixed aspx/MVC webapp project and need to rewrite incoming URL's either
i need to rewrite urls for my classified ads directory i have 4 types
We have a project using LINQ to SQL, for which I need to rewrite
I need to rewrite URL like http://www.example.com/search.php?abc to http://www.example.com/abc using the rules below, but
I have a need to rewrite all URLs except /admin/ to index.html. How would
I have a subdomain setup as onlinedev.domain.com I need to use htaccess to rewrite
I need to rewrite the html in 2 <p> tags when I check a
I need to rewrite some URLs to custom templates. For example, I have a
I have the following URLS which I need to rewrite: product.php?iata=TV&product=12345 to product/Televison/TV/Sony-Bravia/12345 and
I have this URL: http://hostX.site.com/some_path_here/filename.jpg and need to rewrite it to: http://host.site.com/same_path_here/filenameX.jpg Can you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.