in reply to syntax error when using bind_param

I don't believe you can use a placeholder for the table name, only for values.

Replies are listed 'Best First'.
Re^2: syntax error when using bind_param
by davidj (Priest) on Apr 14, 2005 at 20:22 UTC
    You may be correct on that. However, my second attempt at using bind_param does use a literal and it still fails.

    davidj
      In the second example, you're using a literal as the value, but it's still attempting to use a placeholder (the ?) for the table name, which is what can't be done. Unfortunately, you have to construct or query with the table name:
      $qry = "SELECT * FROM $table";
      May or may not help in your case, but a very handy module is SQL::Abstract.