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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:24:10+00:00 2026-06-14T21:24:10+00:00

I’ve tried to get over a millions of rows from a MySQL table to

  • 0

I’ve tried to get over a millions of rows from a MySQL table to PHP my application.

Steps to get data are like bellow.

  1. Send query to mySQL with mysql_query() or mysqli_query()..

  2. Set result to array with looping each rows by using mysql_fetch_array().or add array by using mysqli_fetch_all().

I took messages ‘out of memory’ or ‘allowed memory size of * bytes exhausted’.

I might be able to solve them if I change ‘memory_limit’ .

But I want know why those message was shown.

I’ve changed ’memory_limit’ like 128M-> 512M ->1024M.

When I set 128M,sending query was failed with allowed memory size of *bytes exhausted and I can’t add result to array area.

Then setting 512M, query was finished successfully but I can’t add result to array with allowed memory size of * bytes exhausted.

Finally setting 1024M,both sending query and set result to add result to array was finished .but sometime mysqli_fetch_all() was field with Out of memory.

One thing I can’t understand is why Out of memory isn’t happen constantly?

One more thing I want know is How to get whole rows over a million from a table into PHP less memory turning. After getting whole rows I want let my user to access them by browser operation including download some types of file like csv.

  • 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-14T21:24:11+00:00Added an answer on June 14, 2026 at 9:24 pm

    You will get “allowed memory size of * bytes exhausted’” when the amount of memory needed exceeds the memory limit specified in php.ini file.

    You will get “Out of memory” when the server itself (or Apache or MySQL) runs out of memory.

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

Sidebar

Related Questions

i Tried to get data from excel in java. if i execute it as
I have a mysql table with over 4 million of data; well the problem
I have table one which looks like this. And I want to get data
The object of my query is to get all rows from table a where
I've searched all over and tried everything but I still get: invalid multibyte char
I tried to get an answer from server and conver it to JSONObject .
I tried to get avatar at single (post) page by these codes <?php echo
I tried to get my application run at a specified time but I can't
I have tried to get some information from W3C regarding the update of an
I'm trying to use Hibernate to retrieve approximately 100 million rows from a table.

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.