Jump to content


Large retrieval from MySQL Database

  • Please log in to reply
1 reply to this topic

#1 dredge

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 04 November 2003 - 08:54 PM


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?


#2 shivabharat

  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 07 November 2003 - 05:53 AM

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.
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users