Rene Veerman wrote:
maybe you should be foreach()ing with references?
php.net : search "foreach" :
As of PHP 5, you can easily modify array's elements by preceding
$value with &. This will assign reference instead of copying the
value.
This is possible only if iterated array can be referenced
On Tue, Mar 16, 2010 at 7:06 PM, Ashley Sheridan
wrote:
> On Tue, 2010-03-16 at 23:42 +0100, Rene Veerman wrote:
>
> > maybe adding a > then deprecating >
> > On Tue, Mar 16, 2010 at 7:18 PM, tedd wrote:
> > > At 5:54 PM + 3/15/10, Jochem Maas wrote:
> > >>
> > >> Op 3/13/10 3:49 PM, Jorge
Maybe you want to optimize your script first, and I don't think read
entire data set into array would save you much time.
Don't create new variables when its unnecessary, cache data when its
necessary, try memcached,
and I think heavy php cli scripts are always likely to resume a lot of
resource
What I usually do is to pull a limited set of records ( like 10 or 50
) and the do the operations on them, update a column in that table to
mark them completed and use JavaScript to reload the page and pull the
next set out where that flag field is null.
No memory issue, no need to large timeouts
I have a script that connects to an external database to process about 4,000
records. Each record needs to be operated on pretty heavily, and the script
overall takes about half an hour to execute. We've hit a wall where the
script's memory usage exceeds the amount allocated to PHP. I've increased
On Tue, 2010-03-16 at 23:42 +0100, Rene Veerman wrote:
> maybe adding a then deprecating
> On Tue, Mar 16, 2010 at 7:18 PM, tedd wrote:
> > At 5:54 PM + 3/15/10, Jochem Maas wrote:
> >>
> >> Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> >>>
> >>> First of all, i recommend the use of normal p
maybe adding a wrote:
> At 5:54 PM + 3/15/10, Jochem Maas wrote:
>>
>> Op 3/13/10 3:49 PM, Jorge Gomes schreef:
>>>
>>> First of all, i recommend the use of normal php tags ()
>>> because
>>> the short tags are atm marked as* **DEPRECATED*.
>>
>> that's a documentation error.
>>
>>>
>>> You
On Tue, Mar 16, 2010 at 9:48 PM, Ryan Sun wrote:
> just utilize include_path directive in php.ini
yea, or via ini_set('include_path', );
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
maybe you should be foreach()ing with references?
php.net : search "foreach" :
As of PHP 5, you can easily modify array's elements by preceding
$value with &. This will assign reference instead of copying the
value.
This is possible only if iterated array can be referenced (i.e. is variable),
jumploader.com might be interesting to you..
On Tue, Mar 16, 2010 at 3:19 PM, Richard H Lee wrote:
> p.general,
>
> I have a form with 75 or so file input controls:
> Usually when I submit the form, I only upload two or so files. So in the
> post request, it sends the two files along with the ot
On Tue, Mar 16, 2010 at 1:57 PM, Robert P. J. Day wrote:
>
> and all PHP scripts would start off with something like:
>
> set_include_path(get_include_path() . PATH_SEPARATOR . getenv('PROJ_DIR'));
>
just utilize include_path directive in php.ini
--
PHP General Mailing List (http://www.php.net/
On 03/16/2010 08:50 PM, John Black wrote:
So I just set $include = './include/abc/def/' at the top of the
correction, I set $include to the relative path of the include directory
and then use it like this:
$include = '../../include/';
require $include.'abc/file1.php';
require_once $include.
On 03/16/2010 06:57 PM, Robert P. J. Day wrote:
i have a project (let's call it "proj") which lives in the "proj"
directory and which contains several subdirs, some of which might
contain their own subdirs and so on. some of those subdirs might
contain utility classes that i want to include o
Ashley Sheridan wrote on 16/03/2010 18:28:
I really wouldn't rely on a form that contains more than 20 file upload
boxes though. If someone uploads some large files, they're stuck with an
extremely long wait which will slow down your server a bit as well if a
lot of people are using the same for
At 5:54 PM + 3/15/10, Jochem Maas wrote:
Op 3/13/10 3:49 PM, Jorge Gomes schreef:
First of all, i recommend the use of normal php tags () because
the short tags are atm marked as* **DEPRECATED*.
that's a documentation error.
You should also echo your values to the page, instead using
i have a project (let's call it "proj") which lives in the "proj"
directory and which contains several subdirs, some of which might
contain their own subdirs and so on. some of those subdirs might
contain utility classes that i want to include or require elsewhere,
so i want to be able to just:
> Check out max_file_uploads which was added in PHP 5.2.12 and defaults
to
> 20.
Yes that was the problem, I set max_file_uploads higher and it works
now.
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 2010-03-16 at 18:25 +0100, Daniel Egeberg wrote:
> On Tue, Mar 16, 2010 at 15:19, Richard H Lee wrote:
> > p.general,
> >
> > I have a form with 75 or so file input controls: >
> > Usually when I submit the form, I only upload two or so files. So in the
> > post request, it sends the two
On Tue, Mar 16, 2010 at 15:19, Richard H Lee wrote:
> p.general,
>
> I have a form with 75 or so file input controls:
> Usually when I submit the form, I only upload two or so files. So in the
> post request, it sends the two files along with the other blank 73 fields.
> This has been working fin
Peter Lind wrote:
Hmm, will probably have to look inside PHP for this ... the foreach
loop will copy each element as it loops over it (without actually
copying, obviously), however there's no change happening to the
element at any point and so there's nothing to suggest to the
copy-on-write to cr
Hmm, will probably have to look inside PHP for this ... the foreach
loop will copy each element as it loops over it (without actually
copying, obviously), however there's no change happening to the
element at any point and so there's nothing to suggest to the
copy-on-write to create a new instance
Peter Lind wrote:
This is one example where references actually decrease memory usage.
The main reason is the recursive nature of the function. Try
BTW, it's not the recursive nature of the function causing the problem.
It's the movement of the internal pointer within the array. When it
moves
Peter Lind wrote:
This is one example where references actually decrease memory usage.
The main reason is the recursive nature of the function. Try
Doh, forgot about that :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--
PHP General Mailing List (htt
Always make sure your dynamic sql string in php code are as expected
var_dump($sql) before query
On Thu, Mar 11, 2010 at 10:13 PM, Martine Osias wrote:
> Hi,
>
> My insert statements on this web page don't execute. The select statements
> do work. This tells me that the database connection is wor
2010/3/12 Martine Osias
> Hi,
>
> My insert statements on this web page don't execute. The select statements
> do work. This tells me that the database connection is working. The username
> and password are the administrator's. What else could prevent the insert
> statements from executing?
>
> T
On 3/15/2010 5:03 PM, Jim Lucas wrote:
Al wrote:
Anyone have a regex pattern for deleting multiple backslashes e.g., \\\
I pretty good with regex; but, be damned if I can delete them with
preg_replace()
I've tried "" as the manual says
preg_replace("//", '', $str);
preg_replace
This is one example where references actually decrease memory usage.
The main reason is the recursive nature of the function. Try
wrote:
>
>
> Richard Quadling wrote:
>>
>> On 15 March 2010 23:45, Daevid Vincent wrote:
>>>
>>> Anyone have a function that will return an integer of the number of
>
Richard Quadling wrote:
On 15 March 2010 23:45, Daevid Vincent wrote:
Anyone have a function that will return an integer of the number of
dimensions an array has?
/**
* Get the maximum depth of an array
*
* @param array &$Data A reference to the data array
* @return int The maximum numb
p.general,
I have a form with 75 or so file input controls: Usually when I submit the form, I only upload two or so files. So in the
post request, it sends the two files along with the other blank 73
fields. This has been working fine on my live and test servers so far.
However as of the past
Or maybe you want to check out this:
http://www.codeplex.com/PHPExcel
I havn't checked it out for your special purpose but i found it useful
for some other jobs (especially excell 2007 support).
regards
Jochen
Ashley Sheridan schrieb:
On Tue, 2010-03-16 at 20:16 +0800, I am on the top of th
On 15 March 2010 23:45, Daevid Vincent wrote:
> Anyone have a function that will return an integer of the number of
> dimensions an array has?
/**
* Get the maximum depth of an array
*
* @param array &$Data A reference to the data array
* @return int The maximum number of levels in the array.
From: Ford, Mike
> From: Ashley Sheridan
>> On Tue, 2010-03-16 at 11:16 +, Ford, Mike wrote:
>>
> >>
> >> Proof: http://marc.info/?l=php-internals&m=126832992915664&w=2
> >>
>>
>> That's not really proof of anything, it's just an archived email
>> from this list...
>
> Well, firstly it's a
On Tue, 2010-03-16 at 20:16 +0800, I am on the top of the world!
Borlange University wrote:
> i have a problem of reading values from excel file via
> spreadsheet_excel_reader which is a php class used to manipulate excel
> files.
>
> $data = new Spreadsheet_Excel_Reader();
> $data->setOutputEnco
On 15 March 2010 00:27, Rick Pasotto wrote:
> On Sun, Mar 14, 2010 at 08:40:51PM +, Ashley Sheridan wrote:
>> On Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:
>>
>> > On Sun, Mar 14, 2010 at 06:13:24PM +, Ashley Sheridan wrote:
>> > > On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto w
i have a problem of reading values from excel file via
spreadsheet_excel_reader which is a php class used to manipulate excel
files.
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('CP936');
$data->read("d:\\tmp.xls");
$rows=$data->sheets[0]['numRows'];
$cell = $data->sheets[0]['c
> -Original Message-
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: 16 March 2010 11:16
>
> On Tue, 2010-03-16 at 11:16 +, Ford, Mike wrote:
>
> >
> > Proof: http://marc.info/?l=php-internals&m=126832992915664&w=2
> >
>
> That's not really proof of anything, it'
On Tue, 2010-03-16 at 11:16 +, Ford, Mike wrote:
> > -Original Message-
> > From: Bob McConnell [mailto:r...@cbord.com]
> > Sent: 15 March 2010 18:13
> >
> > From: Jochem Maas
> >
> > > Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> > >> First of all, i recommend the use of normal php ta
> -Original Message-
> From: Bob McConnell [mailto:r...@cbord.com]
> Sent: 15 March 2010 18:13
>
> From: Jochem Maas
>
> > Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> >> First of all, i recommend the use of normal php tags ( ?>)
> because
> >> the short tags are atm marked as* **DEPRECATED
38 matches
Mail list logo