We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12379
    • 460 Posts
    Keeps returning 10 results for all keyword searches - the query itself works fine with an existing php script.

    // Get current page number being viewed...
    $page_number = isset($_GET['page_number']) ? (int) $page_number = $_GET['page_number'] : 1;
    
    // Get number of results per page...
    $entries_per_page = 10;
    
    // Determine offset...
    $offset = ($page_number - 1) * $entries_per_page;
    
    $result = $modx->db->query("SELECT * FROM `modx_api_articles` LEFT OUTER JOIN `modx_api_issues` ON `modx_api_articles`.issue = `modx_api_issues`.id WHERE MATCH(title, keywords, description, topic, author) AGAINST('$search' IN BOOLEAN MODE) ORDER BY `modx_api_issues`.id DESC LIMIT $offset, $entries_per_page");
    
    // Get total number of list entries...
    $total_entries = $modx->db->getRecordCount( $result );
    echo $total_entries;
      Mostly harmless.
      • 4172
      • 5,888 Posts

      try this:
      $result = $modx->db->query("SELECT * FROM `modx_api_articles` LEFT OUTER JOIN `modx_api_issues` ON `modx_api_articles`.issue = `modx_api_issues`.id WHERE MATCH(title, keywords, description, topic, author) AGAINST('$search' IN BOOLEAN MODE) ");
      
      // Get total number of list entries...
      $total_entries = $modx->db->getRecordCount( $result );
      echo $total_entries;
      
      $result = $modx->db->query("SELECT * FROM `modx_api_articles` LEFT OUTER JOIN `modx_api_issues` ON `modx_api_articles`.issue = `modx_api_issues`.id WHERE MATCH(title, keywords, description, topic, author) AGAINST('$search' IN BOOLEAN MODE) ORDER BY `modx_api_issues`.id DESC LIMIT $offset, $entries_per_page");
      
      
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 12379
        • 460 Posts
        Thanks Bruno.
          Mostly harmless.