Jump to content

Recommended Posts

Hello,

 

I have a MySQL database table that will hold 2500 records to begin with and will grow to maybe 10,000 records in the next few years. My question is: is it possible for query arrays to hold that many records? Here\'s an example:

 

$check="SELECT * From Users";

$result=mysql_query($check);

$row=mysql_fetch_array($result);

 

In the above example, if there are 10,000 records in the Users table, then from my understanding $result will get VERY big. Are there limits on how large $result can get? Is there a better way to retrieve the records than this? I am planning on displaying 10-20 records per page, but I figure that I need to get them all first and store them in a session until needed. Is there a better way to do this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/1292-large-retrieval-from-mysql-database/
Share on other sites

I tried with 20,000 records and I dint have any issue. I guess its is not advisable to query a table one the whole and its always advised to break them up. If you try to do

 

select * from table

 

and say you have 1,00,000 records I am sure the page would get stuck and you might get CGI timeout error.

 

So I would recommend you to break the data.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.