[PHP] Report generators: experience, recommendations?

2010-02-13 Thread Jonathan Sachs
I'm looking for a report generator which will be used to create
management reports for my client from a MySQL database. The web site
is implemented in PHP.

Some characteristics that would be nice to have, roughly in order of
importance:

* It is moderately priced (a few hundred dollars at most) or free.

* A developer can easily learn to create moderately complex reports.

* A developer can easily add code to provide functionality not
supported by the generator.

* The generator can be installed on a shared server (it doesn't
require any unusual extensions or changes to php.ino or the server
configuration.

* A non-technical user can easily learn to create simple reports
without help.

A client-server solution is OK. The client has to run on Windows.

I've found one PHP product so far, phpreports. There are many other
reporting tools that might be suitable, but most of them seem to be
written in Java, or else they're black boxes.

Has anyone had experience with report generators that meet these
criteria? What would you recommend; what would you stay away from?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Report generators: experience, recommendations?

2010-02-14 Thread Jonathan Sachs
On Sat, 13 Feb 2010 20:01:35 -0500, n...@ridersite.org (Al) wrote:

>> I'm looking for a report generator which will be used to create
>> management reports for my client from a MySQL database
>>
>> Has anyone had experience with report generators that meet these
>> criteria? What would you recommend; what would you stay away from?
>
>Try Source Forge.

Al: I appreciate your effort to be helpful, but if you review my
original post, you'll find that the question you answered is not the
one I asked.

I hope that others who have used one or more report generators will
share their thoughts.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Possible foreach bug; seeking advice to isolate the problem

2010-10-19 Thread Jonathan Sachs
I've got a script which originally contained the following piece of
code:

foreach ( $objs as $obj ) {
   do_some_stuff($obj);
}

When I tested it, I found that on every iteration of the loop the last
element of $objs was assigned the value of the current element. I was
able to step through the loop and watch this happening, element by
element.

I originally encountered this problem using PHP v5.2.4 under Windows
XP. I later reproduced it in v5.3.2 under XP.

The function call wasn't doing it. I replaced the function call with
an echo statement and got the same result.

For my immediate needs, I evaded the problem by changing the foreach
loop to a for loop that references elements of $objs by subscript.

That leaves me with the question: what is going wrong with foreach?
I'm trying to either demonstrate that it's my error, not the PHP
engine's, or isolate the problem in a small script that I can submit
with a bug report. The current script isn't suitable for that because
it builds $objs by reading a database table and doing some rather
elaborate manipulations of the data.

I tried to eliminate the database by doing a var_export of the array
after I built it, then assigning the exported expression to a variable
immediately before the foreach. That "broke the bug" -- the loop
behaved correctly.

There's a report of a bug that looks similar in the comments section
of php.net's manual page for foreach, time stamped 09-Jul-2009 11:50.
As far as I can tell it was never submitted as a bug and was never
resolved. I sent an inquiry to the author but he didn't respond.

Can anyone make suggestions on this -- either insights into what's
wrong, or suggestions for producing a portable, reproducible example?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-20 Thread Jonathan Sachs
On Wed, 20 Oct 2010 08:37:55 +0200, php-gene...@garydjones.name (Gary)
wrote:

>Better. I can tell you how to solve it:
>$a = array('a', 'b','c');
>foreach($a as &$row){
>//you don't have to do anything here
>}
>unset($row); // <<<< THIS IS KEY!
>print_r($a);
>foreach($a as $row){
>echo "".$row;
>}
>print_r($a);

I don't quite I follow this. I'll have to try it when I have time (I
hope later today) to understand what you're proposing.

Unfortunately it won't work in this, for one or two reasons.

The first possible reason is that I'm not referencing the "as"
variable with an ampersand. If I'd have to add one to fix this
problem, it might cause other problems.

The second (definite) reason is that I can't read the array
destructively (with an unset). The problem occurs in code that is
preparing the array for later read-only use, so that would be
self-defeating!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-22 Thread Jonathan Sachs
Gary wrote:

>Better. I can tell you how to solve it:
>$a = array('a', 'b','c');
>foreach($a as &$row){
>//you don't have to do anything here
>}
>unset($row); // <<<< THIS IS KEY!
>print_r($a);
>foreach($a as $row){
>echo "".$row;
>}
>print_r($a);

I see what you're doing now: unsetting the variable, not the array
element referenced by the variable. You're right, it does work.

It's not exactly better than knowing what's wrong, though... it's
different. I already had a workaround, although it was not quite as
elegant. My desire now is to find out whether the behavior I described
is due to something I don't understand about PHP, or to a bug. If it's
something I don't understand, I want to understand it. If it's a bug,
I want to report it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-23 Thread Jonathan Sachs
On Sat, 23 Oct 2010 08:34:27 +0200, peter.e.l...@gmail.com (Peter
Lind) wrote:

>It is not a bug - somewhere before the foreach loop you've got, a
>variable is being referenced, and that's throwing things off.
>Otherwise, unsetting the variable would have no effect on the problem
>you're seeing.

Could you please be more specific? "Somewhere... a variable is being
referenced" doesn't give me any insight into what is happening.

It's absolutely clear to me WHERE the problem is. The first foreach
loop is causing the problem; I can prove this by removing it. But WHAT
the problem is, is absolutely unclear. I've studied this code every
which way, and I don't see how the first foreach loop can possibly
make the second one change the array -- unless it's a bug.

I've boiled the script down to a couple of dozen lines that
demonstrate the problem without references to a database or to other
scripts. Having this to play with may help others give me some
insight.




 foreach problem 


";

   foreach ( $qs as $q ) {
  echo $qs[0][0] . $qs[1][0] . $qs[2][0] . "";
   }
   
   echo $qs[0][0] . $qs[1][0] . $qs[2][0] . "";
?>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Possible foreach bug; seeking advice to isolate the problem

2010-10-23 Thread Jonathan Sachs
On Sat, 23 Oct 2010 16:56:52 +0200, peter.e.l...@gmail.com (Peter
Lind) wrote:

>More information (and a complete breakdown of your problem) is
>available here:
>http://schlueters.de/blog/archives/141-References-and-foreach.html

Thank you! The situation is obscure and confusing, but that
explanation is quite clear.

Now that I understand it, I can see the same thing would happen if I
wrote the equivalent code in C, and probably in Java.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php