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 6233377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:17:17+00:00 2026-05-24T10:17:17+00:00

I am writing a loop that is building a table. With a mysql_num_row ,

  • 0

I am writing a loop that is building a table. With a mysql_num_row, I get how many persons (18), and I want tables with 6 persons max (so: $Peoples = (mysql_num_row($SQL_statement) /6;).

In the loop, I increment $Count: $Count = $Count + 1;

When I write:

Do{
  [code]
} while($Count == $Peoples);

The condition is not working: after 1 loop it exits from the loop. I printed $Count wich is 1, and $Peoples is 3.

Is there something to do with this?
Thanks!

  • 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-05-24T10:17:18+00:00Added an answer on May 24, 2026 at 10:17 am

    Do you mean to use

    Do{
      [code]
    } while($Count != $Peoples);
    

    (note the inequality check).

    The condition is not working: after 1 loop it exits from the loop. I
    printed $Count wich is 1, and $Peoples is 3.

    == is the equality operator – it checks if both sides are equal.

    Your PHP code is operating correctly – you are telling the code to exit when count is different to people. $Count wich is 1, and $Peoples is 3. meets that criteria. The code I’ve posted above will continue looping while count is not equal to people.

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

Sidebar

Related Questions

I'm writing an inner loop that needs to place struct s in contiguous storage.
I'm writing a script and I need to create a loop that will execute
As I was writing a for loop earlier today, I thought that there must
I'm writing some code so that at each iteration of a for loop it
I think there is a shorter way of writing this foreach loop that creates
I'm writing a message processing application (email) that I want to have an outgoing
In Java is there any way of writing a loop so that you can
So I am writing an Android app and want to have a function that
I have check boxes I want to have a for loop that it will
I am writing code that involved a for loop that makes calculations at each

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.