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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:42:39+00:00 2026-06-06T23:42:39+00:00

PDO seems like a little tricky, but I have a large database and I’m

  • 0

PDO seems like a little tricky, but I have a large database and I’m getting this error,

Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 256 bytes)

When using,

fetchAll()

What is the best way to solve it?

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

    You can temporarily allocate extra memory using:

    ini_set('memory_limit', '750M');
    

    The actual problem is PHP itself not PDO per-se… the PHP Array it’s creating is too big… try above… obviously 750M is a lot but ya get the idea!

    You will probably fine in php.ini memory_limit is 128M by default … resulting in the error you’re getting when the script execution over all exceeds this.

    ALTERNATIVELY:

    (as per my comments) – Only fetch what you can display for the user, i.e. implement some form of Paging.

    A great combination is using jQuery Datatables and server-side pipeline of data. I.e. it will fetch from DB for each page as requested.

    ALSO:

    Make sure your schema has been properly designed and normalised and not just got 100’s of columns!

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

Sidebar

Related Questions

I keep getting this issue with PDO, where this error crops up in my
This refactor seems workable in my head, but I'd like someone to check my
Much have been written about the benefits of using PDO::prepare , but little has
This seems like it should be (and probably is) trivial. I have a simple
I have my array displayed like it but I cant seems to be able
Lets say I have a class like this: Class User { var $id var
That's the first time i get an error like this one, let me explain
I currently have a database call which works in one area, but not another.
I'm evaluating a migration to pdo on some hosts (VPS) but it seems to
the question title seems pretty confusing, but this is what i want to achieve.

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.