I have 5 tables. One primary and 4 additional (they have different columns).
USE CONCAT to create your prepare statement. eg.
@sql = CONCAT('SELECT * FROM objects AS object LEFT JOIN ', @tbl, ' AS info ON object.id = info.obj_id'); PREPARE stmnt FROM @sql; ...