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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:22:41+00:00 2026-06-13T23:22:41+00:00

StackOverflow, $resultpaid = $mysqli->query($paidquery); while ($row=$resultpaid->fetch_array()) { print $row[‘paid’] .'<br />’; } I realize

  • 0

StackOverflow,

$resultpaid = $mysqli->query($paidquery);
while ($row=$resultpaid->fetch_array()) 
{
  print $row['paid'] .'<br />';
}

I realize this should be simple, unfortunately, I’m not well versed in PHP. I’m trying to take the result set from this while loop and assign them to variables. Basically right now it finds two rows, both with integer values. So when it iterates through, it prints out 250 and 260. I’m trying to figure out if there’s a way to assign each row a variable in order to add the integers together, or reference them individually at a certain point.

  • 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-13T23:22:42+00:00Added an answer on June 13, 2026 at 11:22 pm

    Sure, try this,

     $total = 0;
     $resultpaid = $mysqli->query($paidquery);
     while ($row=$resultpaid->fetch_array()) 
     {
      $arr[] = $row['paid']; //gets individual values in an array
      $total += $row['paid']; //adds them up
      print $row['paid'] .'<br />';
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

StackOverflow'ers, I realize the new @mentions is a very new feature to facebook, but
StackOverflow is telling me this is a subjective question, but I think it's a
StackOverflow - I'm still trying to deploy this site, but with every problem I
StackOverflow - I'm still trying to deploy this site, but with every problem I
Hey stackoverflow - This is my first question here. I have 2 tables in
http://stackoverflow.com should become <a href=http://stackoverflow.com>http://stackoverflow.com</a> EDIT: It would be great if anchor tags from
Stackoverflow community. I found out that WSO2 community can be contacted on this site,
StackOverflow has yet to fail me, so don't let me down this time! I
stackoverflow! We are developing system, which should be horizontal scalable. So, messaging system seems
StackOverflow! I have a MS SQL database. The part of this database is presented

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.