in reply to Re^2: Can insert but not select
in thread Can insert but not select

In addition to comments already made, you also want to prepare your statement outside of the loop. You are effectively negating the performance benefit of running the prepare command.

--MidLifeXis