Re: [PHP] How to jump to line number in large file

2008-04-05 Thread Steve McGill
So the only variation on a theme that I didn't test is the one that performs the best by an order of magnitude... nice. Many thanks for your time everyone. "Robert Cummings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Sat, 2008-04-05 at 19:0

Re: [PHP] How to jump to line number in large file

2008-04-05 Thread Steve McGill
"Richard Heyes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Thanks for the heads up on fgetc() incrementing by one. I hadn't actually >> tested that code yet, I was using the original fseek($handle,$pos). >> >> strpos would be ideal but it needs to work on a string and not a fi

Re: [PHP] How to jump to line number in large file

2008-04-05 Thread Steve McGill
Thanks for the heads up on fgetc() incrementing by one. I hadn't actually tested that code yet, I was using the original fseek($handle,$pos). strpos would be ideal but it needs to work on a string and not a file - I don't want to load a 100Mb file into memory if I don't have to. Perhaps I shoul

[PHP] How to jump to line number in large file

2008-04-04 Thread Steve McGill
Hello, I have code where it is appropriate for me to jump to certain lines in a text file and edit that particular line. I need to keep a record of the byte position of every line so that I can fseek to it. I need to do in-line editing so I don't want to write the entire file out again etc. I

Re: [PHP] Unnecessary if statement? Programming technique

2005-12-06 Thread Steve McGill
Hi, David is right about the unwanted side-effect. Thanks for the idea though. Unfortunately the 'greater problem' is not so great, I've just been doing this for a while now and find myself programming loops like these so often and I've never got round to testing if a simple IF statement is a maj

Re: [PHP] HTTP User Authentication Problems

2005-12-06 Thread Steve McGill
Hi Rahul, Try doing a print_r($_SERVER) to see if the variables are being set. If they aren't, take a look at the phpinfo(); -> chances are your host is using a CGI binary version of PHP to use together with a security wrapper like suPHP or phpSuExec, which might throw away the variables that y

[PHP] Unnecessary if statement? Programming technique

2005-12-06 Thread Steve McGill
espond. Best wishes, Steve McGill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP + Javascript, immediate database update

2004-10-27 Thread Steve McGill
Hi everyone, I have a webform which my users are expecting to act like a Windows program, they only need to check the box and it is automatically written to the database. So I'd like to use a combination of javascript, like this, but it isn't quite elegent enough: - Tick the box. - Javascript op

Re: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Steve McGill
> > I think you'll find that your first approach is not only more correct, > > it's the only manageable one. > > No, it will be very slow. The biggest overhead is in transfering data to > and from sql server. It's always better to get the results in one sql query. > > Use this aproach: > > $users =

[PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Steve McGill
se, if it gets too long? Or am I missing a more efficient 3rd / 4th option? Many thanks in advance for your help. Steve McGill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php