Posts: 1,469
Threads: 62
Joined: Jan 2010
Reputation:
0
In my opinion everything looks good.
I never inserted a query in another one, I'd try with strcat to see what happenes instead inserting it.
By the way, try print the final query to know if it's complete.
Good luck.