is defined because it an implicit global variable. This explains why the program never exits.
keeps pushing onto the same global array and then recurses. This doesn't ever finish.
This demonstrates why it is a good idea to
. And why using
to delcare variables is a good idea.
Not to mention the bad database design of storing join'ed values in a single field.