Re: CSV file
| From: | Richard Heyes | Date: | Wed, 24 Jun 2009 18:00:10 +0000 |
| Subject: | Re: CSV file | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294538@lists.php.net to get a copy of this message | ||
Hi,
> If you want to know how many lines there are *before* inserting to the
> database, you can't count "as you go", you have to either read the
> file twice or read it once, store it memory in a variable and then
> insert in the database.
Sure you can, simply do the line count first, then the insert. If it's
a big file it will still be quicker than reading the whole thing into
memory.
--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 20th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp