in reply to Printing wrong results
Well there are several things you can do. Number one being
'use strict' and
'use warnings'
also declare your variables with 'my' especially in the sub-routine, they are all global at the moment. Also it doesn't make much diffence in Perl but you are passing your integer (26) as a string, you should probably remove the "" characters.
Some other problems
You have a recursive call to find_items() which is normally not a good idea.
You have multiple statement handles($sth3,$sth23), its usually better to have one statement handle and call finish() on it after each statement is completed.
Those things will probably go a long way toward finding your problem.
As for you immediate problem its kind of hard to tell without knowing what you are trying to do or what is in your database. But my guess would be that you are getting unexpected results because '$a' is global and gets added to through every recusive call to find_items()
Hope that helps
Chris
|
|---|