<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 43: Display of table with many rows (memory)</title><link href="https://sourceforge.net/p/sqlitemanager/bugs/43/" rel="alternate"/><link href="https://sourceforge.net/p/sqlitemanager/bugs/43/feed.atom" rel="self"/><id>https://sourceforge.net/p/sqlitemanager/bugs/43/</id><updated>2009-08-23T18:14:49Z</updated><subtitle>Recent changes to 43: Display of table with many rows (memory)</subtitle><entry><title>Display of table with many rows (memory)</title><link href="https://sourceforge.net/p/sqlitemanager/bugs/43/" rel="alternate"/><published>2009-08-23T18:14:49Z</published><updated>2009-08-23T18:14:49Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net8fd6383f28bd5734ff905325cb2d8cee7e69cdd9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The scripts eats up memory counting rows of large tables. I made a fix in the SQLiteToGrid.php:&lt;/p&gt;
&lt;p&gt;Here is the changes:&lt;br /&gt;
if (eregi('^SELECT \* FROM', $this-&amp;gt;query)) {&lt;br /&gt;
$q = eregi_replace('^SELECT \* FROM','SELECT COUNT(*) as count FROM', $this-&amp;gt;query);&lt;br /&gt;
if ($this-&amp;gt;SQLiteConnId-&amp;gt;query($q)) {&lt;br /&gt;
$this-&amp;gt;nbRecordQuery = $this-&amp;gt;SQLiteConnId-&amp;gt;fetch_single();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$tabResult = $this-&amp;gt;SQLiteConnId-&amp;gt;array_query($this-&amp;gt;query);&lt;br /&gt;
$this-&amp;gt;nbRecordQuery = count($tabResult);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Here is where:&lt;br /&gt;
function _countRecord(){&lt;br /&gt;
if(!isset($this-&amp;gt;nbRecordQuery)){&lt;br /&gt;
if($this-&amp;gt;SQLiteConnId-&amp;gt;getVersion()==2) {&lt;br /&gt;
$qCount = preg_match('/^\s*(UPDATE|DELETE|INSERT|ALTER|JOIN|GROUP|LIMIT|PRAGMA)\s/i', $this-&amp;gt;query);&lt;br /&gt;
} else {&lt;br /&gt;
$qCount = false;&lt;br /&gt;
}&lt;br /&gt;
if($qCount){&lt;br /&gt;
if($this-&amp;gt;SQLiteConnId-&amp;gt;query($this-&amp;gt;queryCount)){&lt;br /&gt;
$this-&amp;gt;nbRecordQuery = $this-&amp;gt;SQLiteConnId-&amp;gt;fetch_single();&lt;br /&gt;
} else $this-&amp;gt;_sendError($GLOBALS['traduct']-&amp;gt;get(117));&lt;br /&gt;
} else {&lt;br /&gt;
if (eregi('^SELECT \* FROM', $this-&amp;gt;query)) {&lt;br /&gt;
$q = eregi_replace('^SELECT \* FROM','SELECT COUNT(*) as count FROM', $this-&amp;gt;query);&lt;br /&gt;
if ($this-&amp;gt;SQLiteConnId-&amp;gt;query($q)) {&lt;br /&gt;
$this-&amp;gt;nbRecordQuery = $this-&amp;gt;SQLiteConnId-&amp;gt;fetch_single();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
$tabResult = $this-&amp;gt;SQLiteConnId-&amp;gt;array_query($this-&amp;gt;query);&lt;br /&gt;
$this-&amp;gt;nbRecordQuery = count($tabResult);&lt;br /&gt;
}&lt;br /&gt;
}        &lt;br /&gt;
}&lt;br /&gt;
return $this-&amp;gt;nbRecordQuery;&lt;br /&gt;
}&lt;br /&gt;
From, Pestuz&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>