How can I use PHP to show five rows from a MySQL database, then create a new line and show another five, etc?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Use the LIMIT clause if you want to limit the amount of results returned from the query.
If you want to print an
<hr/>after every fifth record you can check it via the modulus operator:Basically, we have a variable used to count how many records we’ve printed. Once that counter can be divided by five, and leave no remainder, we print our horizontal-rule.