Jump to content

limit query to x amount per line then execute command


remybink

Recommended Posts

I see so much about pagination, but what is it called or what is the function to create a "break" after "x" amount of results? I am going to sit here until this website is complete, times are tough and I must launch a better website.

 

Thank you for any help you guys can and did offer.

Link to comment
Share on other sites

I don't want to pass it to the next page I want the result on the same page

so line 1) 5 products

 

line 2) break of some sort

line 3) 5 more products

 

etc

 

Thank you for your input, I will practice with the limit function anyway

Link to comment
Share on other sites

Then just implement that in your code that processes the results

$group_records = 5;
$recordCount = 0;
while($row = mysql_fetch_assoc($result))
{
    $recordCount++;

    //Display the record

    if($recordCount%$group_records == 0)
    {
         //Display something between each group of records
    }

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.