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

  • SEARCH
  • Home
  • 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 8949159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:10:21+00:00 2026-06-15T13:10:21+00:00

<?php if($userinfo->num_rows == 0) echo (<p style=’color: #f00;’>No users in this department<p>); else{ $x

  • 0
    <?php if($userinfo->num_rows == 0)
    echo ("<p style='color: #f00;'>No users in this department<p>");
    else{
    $x = 0;
    echo '<ul class="thumbnails">';
    while($userDetail = $userinfo->fetch_assoc()){
    $x ++;
    echo '
    <li class="span3">
    <div class="thumbnail">
    <a href="#" data-toggle="modal" data-target="#user'.$x.'"><img class="default"                                            src="'.$userDetail['photo'].'" alt="" /></a>
    <div class="caption">
    <h5>'.$userDetail['first'].' '.$userDetail['last'].'</h5>
    <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#user'.$x.'">View Details</a></p>
    </div>
    </div>
    </li>
    (other code)

This is a bootstrap thumbnail. I need PHP to count 4 users in one row and then star ta new row of users. How can I do this?

  • 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-15T13:10:22+00:00Added an answer on June 15, 2026 at 1:10 pm

    You can use the modulus to find out if the current thumbnail is the last in a row of four:

    $is_last_of_four = $x % 4 === 0;
    

    You can use this result to insert additional markup that ends the current row and starts a new one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
I'm developing a class and I have this structure: class userInfo { public $interval
In my zend layout.phtml I am serving my navigation like this: <?php $userInfo =
PHP experts, I've been working on this problem for about a day and a
I'm trying to make oop class to get user info but i get this
in this simple php file: ( http://gist.github.com/273402 ) <?php session_start(); include_once 'libraries/facebook/facebook.php'; //$fb_user=$facebook->get_loggedin_user(); ?>
Please see this example: if (strlen($_SESSION['userDetails']['THISNAME']) == 0) { $_SESSION['userDetails'][''.$THISNAME.'Error'] = autofocus; include $docRoot/html/forms/reg/user_info.html.php;
PHP has PHP-FPM, a pool of PHP processes that run, are managed, go away
PHP - Access MSSQL datetime column from the returned array Array ( [0] =>
PHP has some pretty inconsistent parameters for functions (e.g. sometimes first haystack , then

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.