You're prepare()ing your statement twice before executing it. That's your problem.
You really should look into placeholders, too. If you use them, they'll allow you to avoid that annoying single-quote/double-quote breakdancing you're doing in your first prepare statement. They take care of all quote escaping, too, so you'll never have to worry about quotes breaking queries again.
-Any sufficiently advanced technology is
indistinguishable from doubletalk.
In reply to Re: MySQL Error
by Hero Zzyzzx
in thread MySQL Error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |