Need help making the database show more results in categories

Discussion in 'Databases' started by excaliburwebdesigners, Sep 13, 2007.

  1. #1
    Hi

    i have a funny jokes website and when browsing through the categories it displays 10 results per page but i want it to display about 20 per page so it fill the template better.

    I think i have found the code in the category file which is:

                                 <? 
    		$qry="select * from addjoke where jokecat='$id' and jokeactivation='1' order by jokeid desc LIMIT $from, $max_results";
    		$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM addjoke where  jokecat='$id' and jokeactivation='1'"),0); 
    $total_pages = ceil($total_results / $max_results);
    	
    			$result=mysql_query($qry) or die($qry);
    			if(mysql_num_rows($result)=='0')
    			{?>
    Code (markup):
    Can anyone help as to which part of code to change.

    Regards. :)
     
    excaliburwebdesigners, Sep 13, 2007 IP
  2. medicalhumor

    medicalhumor Peon

    Messages:
    1,393
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #2
    find where $max_results is defined in your script (or even admin section if there is one)
    Assign it's value to 20
     
    medicalhumor, Sep 13, 2007 IP
    excaliburwebdesigners likes this.
  3. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Cheers, i went back in and found the $max_results was defined right at the top of the page, DOH!

    All sorted now.

    Thanks again, rep added:)
     
    excaliburwebdesigners, Sep 13, 2007 IP