Re: [PHP] a better way to do a data import?

2008-01-22 Thread Richard Lynch
If you unset/NULL out *every* variable, then you should not run out of RAM... It might be a heck of a lot faster to LOAD DATA INFILE to a temp table, and then use SQL statements to compare the data and update/insert any altered/missing data... I do something similar with about the same number of

[PHP] a better way to do a data import?

2008-01-21 Thread blackwater dev
I have a text file that contains 200k rows. These rows are to be imported into our database. The majority of them will already exists while a few are new. Here are a few options I've tried: I've had php cycle through the file row by row and if the row is there, delete it and do a straight

Re: [PHP] a better way to do a data import?

2008-01-21 Thread Eric Butera
On Jan 21, 2008 12:35 PM, blackwater dev [EMAIL PROTECTED] wrote: I have a text file that contains 200k rows. These rows are to be imported into our database. The majority of them will already exists while a few are new. Here are a few options I've tried: I've had php cycle through the

Re: [PHP] a better way to do a data import?

2008-01-21 Thread Robert Cummings
On Mon, 2008-01-21 at 12:35 -0500, blackwater dev wrote: I have a text file that contains 200k rows. These rows are to be imported into our database. The majority of them will already exists while a few are new. Here are a few options I've tried: I've had php cycle through the file row

Re: [PHP] a better way to do a data import?

2008-01-21 Thread blackwater dev
I think that's possible, so I'll give it a shot. For some reason, even with straight inserts my php script is dying around 180,000 rows. Basically, I took out all the compare/update code so now I grab the row from the db and if there isn't one, do an insert. I've wiped my db so should do

Re: [PHP] a better way to do a data import?

2008-01-21 Thread Eric Butera
On Jan 21, 2008 1:08 PM, blackwater dev [EMAIL PROTECTED] wrote: I think that's possible, so I'll give it a shot. For some reason, even with straight inserts my php script is dying around 180,000 rows. Basically, I took out all the compare/update code so now I grab the row from the db and if

RE: [PHP] a better way to do a data import?

2008-01-21 Thread Bastien Koert
what about uploading the entire file into a [semi]temp table..then doing cross table comparisons to load your main table with the data? bastien Date: Mon, 21 Jan 2008 13:08:27 -0500 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: Re: [PHP] a better way to do a data import? I

Re: [PHP] a better way to do a data import?

2008-01-21 Thread Chris
blackwater dev wrote: I have a text file that contains 200k rows. These rows are to be imported into our database. The majority of them will already exists while a few are new. Here are a few options I've tried: I've had php cycle through the file row by row and if the row is there, delete

[PHP] A better way to do this

2005-10-23 Thread Ross
I want the selct table to retain it's value on submit. The way I have done it works but is a bit rubbish and was wondering if there is a more efficient way. I just make the variable equal to selected when the form is submitted select name=table_name id=table_name option value=1

Re: [PHP] A better way to do this

2005-10-23 Thread Jasper Bryant-Greene
On Sun, 2005-10-23 at 20:23 +0100, Ross wrote: I want the selct table to retain it's value on submit. The way I have done it works but is a bit rubbish and was wondering if there is a more efficient way. I just make the variable equal to selected when the form is submitted select

Re: [PHP] A better way to do this in php???

2004-10-21 Thread Brent Baisley
Here's a one liner that gives the minutes since midnight: floor( (time()-mktime(0,0,0, date( 'm' ), date( 'd' ), date( 'Y' )))/60); Both time() and mktime() return the seconds since epoch. Time is based on current time, and the mktime parameters base it on midnight. A simple subtraction gives

[PHP] A better way to do this in php???

2004-10-20 Thread bclem
I need to find the exact time of day using minutes since midnight. What is the easiest and/or better way to do this in php? This is how I'm doing it now. // $iMinutes is the total number of minutes since midnight/12am // 0 = midnight/12am // 1439 = 11:59pm $iMinutes = 1230; if ($iMinutes 0

Re: [PHP] A better way to do this in php???

2004-10-20 Thread trenton
Why not use the date function? date(g:i a); Trenton I need to find the exact time of day using minutes since midnight. What is the easiest and/or better way to do this in php? This is how I'm doing it now. // $iMinutes is the total number of minutes since midnight/12am // 0 =

Re: [PHP] A better way to do this in php???

2004-10-20 Thread Robert Cummings
On Wed, 2004-10-20 at 19:37, [EMAIL PROTECTED] wrote: Why not use the date function? date(g:i a); The OP wants to get the time based on a value indicating the number of minutes since midnight. He doesn't want the current time. The following should give him what he needs: $iMinutes =