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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:45:41+00:00 2026-05-26T01:45:41+00:00

I tried storing data to php array from mysql using under code. But it’s

  • 0

I tried storing data to php array from mysql using under code. But it’s not working.
This code:

echo $answerArray[count][i];

shows the correct result. But this code:

echo $answerArray[0][0];

doesn´t show anything.

What should I do to fix it?
Thank you.

Full code:

   $count = 0; //answer count
   $answerArray = array();
    while ($row = mysqli_fetch_array($resultFromR, MYSQLI_ASSOC)) { //add array from db
     for($i = 0; $i < $questionNumber; $i++) {
     $j = $i + 1;
     $answerArray[count][i] = $row["num$j"];
     echo $answerArray[count][i]; //is working.
     }
$count++;
}
echo '<br />';
echo $answerArray[0][0]; //something wrong!!! I cannot get anything from 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-05-26T01:45:42+00:00Added an answer on May 26, 2026 at 1:45 am

    maybe this will work

     $answerArray[$count][$i] = $row["num$j"];
    

    (add $ before count and i)

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

Sidebar

Related Questions

I'm using PHP's cURL function to read profiles from steampowered.com. The data retrieved is
I tried decoding this base64 string so many times but every time i get
I tried many things but I always get cannot convert string to membershipuser from
I'm using a jQuery ajax json call to retrieve a 3 dimensional PHP array
I am trying to post to a REST service using PHP cURL but I'm
I am so confused right now, I am using code igniter php framework and
I'm struggling to parse the below data using PHP. An API returns it, and
I want to sent the data from an Android device to PHP. I have
I'm trying to POSTing some data (a JSON string) from a php script to
I've tried this: string newScript = textBox1.Text; HtmlElement head = browserCtrl.Document.GetElementsByTagName(head)[0]; HtmlElement scriptEl =

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.