CodeIgniter Forums

Full Version: MySQL can't get all records
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]kptengco[/eluser]
i have 50,000 records on my table and i use this
Code:
$this->db->get('table_name');

and when i print it,
Code:
<pre>
&lt;?php echo print_r($this->db->get('table_name')); ?&gt;
</pre>
it returns 29,455 max record only. what i need is to get all the rows (50,000 records).


i also tried this one
Code:
$this->db->get('tblname',50000,0);
and this
Code:
$this->db->limit(50000)->get('tblname');
but same result :down:

please help me guys how to fix this :-S

El Forum

[eluser]Samus[/eluser]
Use pagination dude.

Loading 50k records is just way too ineffecient imo. It'lltake 10 - 20 seconds to render the full page and that isn't taking into account any other assets you may have there.

http://ellislab.com/codeigniter/user-gui...ation.html

El Forum

[eluser]kptengco[/eluser]
:-S i just want to make a data migration tool that can load/insert a 50k up record. anyways thnx for the feedback dude :lol:

El Forum

[eluser]pbflash[/eluser]
Did you try doing a count on the query result? There is a chance that all the records are there but are not displayed due to some limitation.

El Forum

[eluser]kptengco[/eluser]
the
Code:
num_rows()
? yep its still in a limit of 29,455 number of records i also did mysql_num_rows()

but if i use
Code:
mysql_query()
it get all the records.

El Forum

[eluser]Aken[/eluser]
What happens if you forego active record and use $this->db->query() ?

El Forum

[eluser]kptengco[/eluser]
oh i didn't try that yet..
Code:
$this->db->query

Is it differ with this one
Code:
$this->db->query('SELECT * FROM tbl'); to $this->db->get('tbl');

El Forum

[eluser]Aken[/eluser]
I would normally assume not, but it's worth a check.

It's possible that it's a PHP limitation and not a MySQL.