Re: [PHP] Very Large text file parsing

2007-09-20 Thread Chris
As for MySQL, if the table that you are inserting to has any indexes at all, then each time your insert/update completes MySQL will re-index the table. That'll happen for any database (I don't know that it really re-indexes, rather it has to update the index instead). Therefor, if you can

[PHP] php personal project

2007-09-20 Thread Karl james
Team, I am in need of some help. I would love to get some assistance on this. I need to start creating a database for my website. This will be for a fantasy football league website. To store stats on the database for archive purposes, And be able to pull them out on html reports. I wan

Re: [PHP] Working with XML: DomDocument or SimpleXML?

2007-09-20 Thread Per Jessen
Colin Guthrie wrote: > I like working with SimpleXML but DomDocument seems more useful in > some cases (e.g. working with XSLT transforms etc.). In PHP4 we used the xslt extension (for sablotron), but when this went away in PHP5, we moved to the DOMDocument stuff, which is working fine. Seems to

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Per Jessen
Paul Scott wrote: > Thanks to all for the suggestions - I now have to figure out the best > way to manipulate every single record in that table (now over 6.5 > million rows) to add in a field (RDBMS function in C - so much > easier)... Isn't that just an ALTER ? /Per Jessen, Zürich -- PHP Ge

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Jim Lucas
Chris wrote: Paul Scott wrote: On Thu, 2007-09-20 at 09:54 -0300, Martin Marques wrote: If not, you should just use the COPY command of PostgreSQL (you are using PostgreSQL if I remember correctly) or simply do a bash script using psql and the \copy command. Unfortunately, this has to work

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Paul Scott
On Fri, 2007-09-21 at 08:34 +0200, Paul Scott wrote: > Thanks to all for the suggestions - I now have to figure out the best > way to manipulate every single record in that table (now over 6.5 > million rows) to add in a field (RDBMS function in C - so much > easier)... > Oh, and by the way, add

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Paul Scott
On Fri, 2007-09-21 at 15:51 +1000, Chris wrote: > (Personally I'd use perl over php for processing files that large but > that may not be an option). Thanks for all of the suggestions, I seem to have it working quite well now, although the client has just contacted me and said that they had "mad

Re: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Chris
And here is the dump of the $_FILES array (which, notably, reports zero as the size): [error] => 2 And also gives you an error code. http://www.php.net/manual/en/features.file-upload.errors.php -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailin

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Chris
Paul Scott wrote: On Thu, 2007-09-20 at 09:54 -0300, Martin Marques wrote: If not, you should just use the COPY command of PostgreSQL (you are using PostgreSQL if I remember correctly) or simply do a bash script using psql and the \copy command. Unfortunately, this has to work on all suppor

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Paul Scott
On Thu, 2007-09-20 at 09:54 -0300, Martin Marques wrote: > If not, you should just use the COPY command of PostgreSQL (you are > using PostgreSQL if I remember correctly) or simply do a bash script > using psql and the \copy command. > Unfortunately, this has to work on all supported RDBM's -

RE: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Bastien Koert
Max file size is a hint to the browser and not all support it...you can't count on it bastien > To: php-general@lists.php.net> Date: Thu, 20 Sep 2007 14:45:36 -0500> From: > [EMAIL PROTECTED]> Subject: [PHP] MAX_FILE_SIZE not working with file > uploads> > The punchline question is: What am

Re: [PHP] disappearing array?

2007-09-20 Thread David Otton
On Thu, 20 Sep 2007 12:58:28 -0600, you wrote: >I am not sure what the heck is going with this but here is my problem. > >I am trying to validate the contents of an array, then determine if the >errors are with the array or another form submitted variable. > >The problem is after the code validate

[PHP] Re: Working with XML: DomDocument or SimpleXML?

2007-09-20 Thread Colin Guthrie
Robert Cummings wrote: > I still use PHP4 so I wrote my own XML handling class that wraps the > xml_xxx() series of functions. Haven't had a problem with it. Makes > working with XML very easy since it uses a path string syntax to > focus/access nodes and attributes: Cheers for that. I know I def

Re: [PHP] Finding next recored in a array

2007-09-20 Thread brian
tedd wrote: At 4:14 PM -0400 9/19/07, brian wrote: tedd wrote: >>> Duh? You program for that -- you want me to write the entire code? ~sigh~ Grasshopper, the point i was trying to make is that your example displays what *not* to do with array_search(). Though a wonderful teaching aid in

RE: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Instruct ICC
In the To: php-general@lists.php.net> Date: Thu, 20 Sep 2007 14:45:36 -0500> From: [EMAIL PROTECTED]> Subject: [PHP] MAX_FILE_SIZE not working with file uploads>> The punchline question is: What am I missing?>> Now for the details.>> I have a form through which a user uploads image files. In t

RE: [PHP] disappearing array?

2007-09-20 Thread Instruct ICC
Wow this formatted badly. (new hotmail on Safari -- MS made FF not even render well) Anyway, are you sure you are reaching the code you want to reach? Perhaps !== is overkill and maybe even wrong when you should use ==. Same with the other === usage? Try some echo "HERE1\n"; echo "HERE2\n"; t

Re: [PHP] safe_mode & exec()

2007-09-20 Thread Robert Cummings
On Thu, 2007-09-20 at 16:14 -0400, tedd wrote: > Hi gang: > > Would someone be so kind as to explain to me how one can use exec() > with safe_mode on? http://ca.php.net/manual/en/features.safe-mode.php#ini.safe-mode-exec-dir Cheers, Rob. -- .

Re: [PHP] Working with XML: DomDocument or SimpleXML?

2007-09-20 Thread Robert Cummings
On Thu, 2007-09-20 at 20:34 +0100, Colin Guthrie wrote: > Hi, > > Just wondering what people's general opinion is on working with XML in PHP? > > I like working with SimpleXML but DomDocument seems more useful in some > cases (e.g. working with XSLT transforms etc.). > > So what do you thing? Or

[PHP] safe_mode & exec()

2007-09-20 Thread tedd
Hi gang: Would someone be so kind as to explain to me how one can use exec() with safe_mode on? TIA, Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsu

Re: [PHP] Finding next recored in a array

2007-09-20 Thread tedd
At 4:14 PM -0400 9/19/07, brian wrote: tedd wrote: At 11:52 AM -0400 9/17/07, brian wrote: tedd wrote: Richard Kurth wrote: $Campaign_array| = array('0','1','3','5','8','15','25');| I know that I can find the next recored in a array using next. What I do not understand is if I know the la

RE: [PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Instruct ICC
In the _ More photos; more messages; more whatever – Get MORE with Windows Live™ Hotmail®. NOW with 5GB storage. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907 -- PHP General Mailing Li

Re: [PHP] newbie trying to find segfault reasons

2007-09-20 Thread Jürgen Wind
just don't use php 5.1.6 Chris Curvey-2 wrote: > > Hey all, > > I'm kinda new at PHP (but not entirely new). I'm having a heck of a > time with PHP causing my apache processes to segfault. I've found a few > cases where it's something simple, like referring to an object property > that doe

[PHP] MAX_FILE_SIZE not working with file uploads

2007-09-20 Thread Jeff Cohan
The punchline question is: What am I missing? Now for the details. I have a form through which a user uploads image files. In the event the chosen file exceeds the MAX_FILE_SIZE (which I have included as a hidden form field immediately after the form tag), I want to abort the upload process and d

[PHP] Working with XML: DomDocument or SimpleXML?

2007-09-20 Thread Colin Guthrie
Hi, Just wondering what people's general opinion is on working with XML in PHP? I like working with SimpleXML but DomDocument seems more useful in some cases (e.g. working with XSLT transforms etc.). So what do you thing? Or do would you simply create a few utility classes to handle conversions?

[PHP] disappearing array?

2007-09-20 Thread Jas
I am not sure what the heck is going with this but here is my problem. I am trying to validate the contents of an array, then determine if the errors are with the array or another form submitted variable. The problem is after the code validates the array and other form variables using an if state

RE: [PHP] newbie trying to find segfault reasons

2007-09-20 Thread Jay Blanchard
[snip] I'm kinda new at PHP (but not entirely new). I'm having a heck of a time with PHP causing my apache processes to segfault. I've found a few cases where it's something simple, like referring to an object property that does not exist, but it's painstaking work. I'm reduced to commenting

[PHP] newbie trying to find segfault reasons

2007-09-20 Thread Chris Curvey
Hey all, I'm kinda new at PHP (but not entirely new). I'm having a heck of a time with PHP causing my apache processes to segfault. I've found a few cases where it's something simple, like referring to an object property that does not exist, but it's painstaking work. I'm reduced to commen

Re: [PHP] scaling and uploading the pt 2

2007-09-20 Thread brian
Hulf wrote: This is the full code so far. The files are saving but they are not resizing. Can anyone help? I need to get this $myimage = imagejpeg($thumb); into $target_path directory. H. -- if(isset($_POST['_upload']) && $_FILES['userfile']['size'

[PHP] scaling and uploading the pt 2

2007-09-20 Thread Hulf
This is the full code so far. The files are saving but they are not resizing. Can anyone help? I need to get this $myimage = imagejpeg($thumb); into $target_path directory. H. -- if(isset($_POST['_upload']) && $_FILES['userfile']['size'] > 0) { $ima

[PHP] Re: scaling images

2007-09-20 Thread Puiu Hrenciuc
Hulf wrote: Sorry my message was cut off. Yes I want to scale to 300 x 200px before I upload the image to my folder. Here is my code so far. thanks, H. $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); echo $x=$imageinfo[0]; echo $y=$imageinfo[1]; $newwidth = 300; $newheight =

[PHP] Re: scaling images

2007-09-20 Thread Hulf
Sorry my message was cut off. Yes I want to scale to 300 x 200px before I upload the image to my folder. Here is my code so far. thanks, H. $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); echo $x=$imageinfo[0]; echo $y=$imageinfo[1]; $newwidth = 300; $newheight = 200; // Load

Re: [PHP] scaling images

2007-09-20 Thread Jim Lucas
Hulf wrote: I have images of varying sizes. I want them to be scaled prior to upload to a set size of 300 x 200 px $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); $ix=$imageinfo[0]; $iy=$imageinfo[1]; //upload the images script I So, let me get this straight, you want to resi

Re: [PHP] How can I make clean URL site with PHP?

2007-09-20 Thread Robert Cummings
On Thu, 2007-09-20 at 23:12 +0900, js wrote: > Hi. > > I like clean URL site like http://del.icio.us/someone/tag > (del.icio.us is powered by PHP, right?) > > But I have no idea how can I do it with PHP. > Is this a just apache's rewrite magic? or another different technique? Apache rewrite magi

[PHP] How can I make clean URL site with PHP?

2007-09-20 Thread js
Hi. I like clean URL site like http://del.icio.us/someone/tag (del.icio.us is powered by PHP, right?) But I have no idea how can I do it with PHP. Is this a just apache's rewrite magic? or another different technique? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

Re: [PHP] scaling images

2007-09-20 Thread Daniel Brown
That's nice. On 9/20/07, Hulf <[EMAIL PROTECTED]> wrote: > I have images of varying sizes. I want them to be scaled prior to upload to > a set size of 300 x 200 px > > > $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); > > $ix=$imageinfo[0]; > $iy=$imageinfo[1]; > > > > //upload the

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread Puiu Hrenciuc
C.R.Vegelin wrote: - Original Message - From: "Puiu Hrenciuc" <[EMAIL PROTECTED]> To: Sent: Thursday, September 20, 2007 12:56 PM Subject: Re: [PHP] highlighting searchterms as bold text Sorry, I didn't read d) right (NOT Methyl), here is teh new regex : /(\b#SearchTermHere#(\w+)?)/i

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Per Jessen
Paul Scott wrote: > Code: > [SNIP] > $row = 1; > $handle = fopen($csvfile, "r"); > while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) { > $num = count($data); > $row++; > $insarr = array('userid' => $userid, > 'geonameid' => $data[0], [snip] > $thi

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Per Jessen
Paul Scott wrote: > On Thu, 2007-09-20 at 12:50 +0100, Edward Kay wrote: >> In addition to Martin's good suggestions (and also assuming you're >> running php-cli via cron), you could use nice to stop it consuming >> too many resources: >> > > This is the current approach that I am taking, was ju

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Martin Marques
Paul Scott wrote: On Thu, 2007-09-20 at 08:03 -0400, Robert Cummings wrote: Post some samples of the data you are parsing and a sample of the code you've written to parse them. If you're parsing 750 megs of data then it's quite likely you could squeeze some performance out of the parse routines

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Robert Cummings
On Thu, 2007-09-20 at 14:25 +0200, Paul Scott wrote: > On Thu, 2007-09-20 at 08:03 -0400, Robert Cummings wrote: > > Post some samples of the data you are parsing and a sample of the code > > you've written to parse them. If you're parsing 750 megs of data then > > it's quite likely you could squee

[PHP] scaling images

2007-09-20 Thread Hulf
I have images of varying sizes. I want them to be scaled prior to upload to a set size of 300 x 200 px $imageinfo = getimagesize($_FILES['userfile']['tmp_name']); $ix=$imageinfo[0]; $iy=$imageinfo[1]; //upload the images script I -- PHP General Mailing List (http://www.php.net/) To unsubs

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Martin Marques
Robert Cummings wrote: On Thu, 2007-09-20 at 13:55 +0200, Paul Scott wrote: On Thu, 2007-09-20 at 12:50 +0100, Edward Kay wrote: In addition to Martin's good suggestions (and also assuming you're running php-cli via cron), you could use nice to stop it consuming too many resources: This is the

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread C.R.Vegelin
- Original Message - From: "Puiu Hrenciuc" <[EMAIL PROTECTED]> To: Sent: Thursday, September 20, 2007 12:56 PM Subject: Re: [PHP] highlighting searchterms as bold text Sorry, I didn't read d) right (NOT Methyl), here is teh new regex : /(\b#SearchTermHere#(\w+)?)/i The code sample i

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Paul Scott
On Thu, 2007-09-20 at 08:03 -0400, Robert Cummings wrote: > Post some samples of the data you are parsing and a sample of the code > you've written to parse them. If you're parsing 750 megs of data then > it's quite likely you could squeeze some performance out of the parse > routines themselves.

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread C.R.Vegelin
- Original Message - From: "Deniz Dizman (BST UGB)" <[EMAIL PROTECTED]> To: "C.R.Vegelin" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED]" Sent: Thursday, September 20, 2007 12:25 PM Subject: RE: [PHP] highlighting searchterms as bold text you probably have some characters before/after the ph

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread Robert Cummings
On Thu, 2007-09-20 at 13:09 +0100, C.R.Vegelin wrote: > - Original Message - > From: "Deniz Dizman (BST UGB)" <[EMAIL PROTECTED]> > To: "C.R.Vegelin" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED]" > > Sent: Thursday, September 20, 2007 11:29 AM > Subject: RE: [PHP] highlighting searchterms as

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Robert Cummings
On Thu, 2007-09-20 at 13:55 +0200, Paul Scott wrote: > On Thu, 2007-09-20 at 12:50 +0100, Edward Kay wrote: > > In addition to Martin's good suggestions (and also assuming you're running > > php-cli via cron), you could use nice to stop it consuming too many > > resources: > > This is the current

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Paul Scott
On Thu, 2007-09-20 at 12:50 +0100, Edward Kay wrote: > In addition to Martin's good suggestions (and also assuming you're running > php-cli via cron), you could use nice to stop it consuming too many > resources: > This is the current approach that I am taking, was just really wondering if there

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread Puiu Hrenciuc
Sorry, I didn't read d) right (NOT Methyl), here is teh new regex : /(\b#SearchTermHere#(\w+)?)/i The code sample is the same, replace regex, of course . Output should be : ethyl Lorem Ethyl ipsum MeThYl dolor Ethylene sit Cheers Puiu Hrenciuc wrote: Hi, Here's what you need: RegEx: /((

RE: [PHP] Very Large text file parsing

2007-09-20 Thread Edward Kay
> Paul Scott wrote: > > I have a very large text file that gets dumped into a directoory every > > now and then. It is typically around 750MB long, at least, and my > > question is: > > > > What is the best method to parse this thing and insert the data into a > > postgres db? > > > > I have tried

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread Puiu Hrenciuc
Hi, Here's what you need: RegEx: /((\w+)?#SearchTermHere#(\w+)?)/i Of course, replace your #SearchTermHere# with what you need, i.e. /((\w+)?ethyl(\w+)?)/i Code sample: $_textToHighlight='ethyl Lorem Ethyl ipsum MeThYl dolor Ethylene sit'; $_search='/((\w+)?ethyl(\w+)?)/i'; $_replace='\\1';

Re: [PHP] Very Large text file parsing

2007-09-20 Thread Martin Marques
Paul Scott wrote: I have a very large text file that gets dumped into a directoory every now and then. It is typically around 750MB long, at least, and my question is: What is the best method to parse this thing and insert the data into a postgres db? I have tried using file(), fget*() and some

[PHP] Very Large text file parsing

2007-09-20 Thread Paul Scott
I have a very large text file that gets dumped into a directoory every now and then. It is typically around 750MB long, at least, and my question is: What is the best method to parse this thing and insert the data into a postgres db? I have tried using file(), fget*() and some others, all with l

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread C.R.Vegelin
- Original Message - From: "Deniz Dizman (BST UGB)" <[EMAIL PROTECTED]> To: "C.R.Vegelin" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED]" Sent: Thursday, September 20, 2007 11:29 AM Subject: RE: [PHP] highlighting searchterms as bold text thats odd because the regex passes when I test it w

RE: [PHP] highlighting searchterms as bold text

2007-09-20 Thread Ford, Mike
On 20 September 2007 11:34, Edward Kay wrote: > > > Hi everyone, > > > > > > I want to highlight (bold) searchterms in text. > > > For example, for all words starting with "ethyl": > > > a) replace "ethyl" by "ethyl" > > > b) replace "Ethyl" by "Ethyl" > > > c) replace "ethylene" by "ethylene" >

RE: [PHP] highlighting searchterms as bold text

2007-09-20 Thread Edward Kay
> > Hi everyone, > > > > I want to highlight (bold) searchterms in text. > > For example, for all words starting with "ethyl": > > a) replace "ethyl" by "ethyl" > > b) replace "Ethyl" by "Ethyl" > > c) replace "ethylene" by "ethylene" > > d) but not "methyl" by "methyl" > > > > Now I use: > > $pat

Re: [PHP] highlighting searchterms as bold text

2007-09-20 Thread C.R.Vegelin
- Original Message - From: "Deniz Dizman (BST UGB)" <[EMAIL PROTECTED]> To: "C.R.Vegelin" <[EMAIL PROTECTED]>; "[EMAIL PROTECTED]" Sent: Thursday, September 20, 2007 10:38 AM Subject: RE: [PHP] highlighting searchterms as bold text try /^ethyl/i what you want is ignore case and patt

[PHP] highlighting searchterms as bold text

2007-09-20 Thread C.R.Vegelin
Hi everyone, I want to highlight (bold) searchterms in text. For example, for all words starting with "ethyl": a) replace "ethyl" by "ethyl" b) replace "Ethyl" by "Ethyl" c) replace "ethylene" by "ethylene" d) but not "methyl" by "methyl" Now I use: $patterns[0] = "/ethyl/"; $replacements[0] = "e

Re: [PHP] Open New URL window FINAL ANSWER

2007-09-20 Thread Chris
Andrew Prostko wrote: Wow, it really must be late, Thank you for pointing out that missing parenthesis ... 330am and now I can go to bed happy... TY VM Ending Code for anyone listening: Get PW from another .php page using: What is the Password?: This is the passwordcheck.php code: You

Re: [PHP] Open New URL window

2007-09-20 Thread Stut
Andrew Prostko wrote: Ok, so I started using the header code that was suggested: And I get this error: Parse error: parse error, unexpected '{' in /home/char-lee/public_html/beta/1.php on line 3 This is the code: --- You'll be wanting to put burgers in quotes and close the bracket

RE: [PHP] Open New URL window FINAL ANSWER

2007-09-20 Thread Andrew Prostko
Wow, it really must be late, Thank you for pointing out that missing parenthesis ... 330am and now I can go to bed happy... TY VM Ending Code for anyone listening: Get PW from another .php page using: What is the Password?: This is the passwordcheck.php code: -- PHP General Mailing Lis

Re: [PHP] Open New URL window

2007-09-20 Thread Don Read
On Thu, 20 Sep 2007 02:52:19 -0400 Andrew Prostko said: Ok, so I started using the header code that was suggested: And I get this error: Parse error: parse error, unexpected '{' in /home/char-lee/public_html/beta/1.php on line 3 This is the code: --- --- -- PHP Gene