try echoing the query before entering it into mysql. most of te time you'll see what's wrong
just a small note: if you are going to allow user's to create a table, i don't think that's very wise: it is better to do it yourself, for security reasons.
Show me the query, and i'll see what's wrong
UnrealEd