Fabian Köhler wrote:
> i have table with answers to questions. Every answer is a column in the table. i.e.
> another option to save it would be sth like this:
> The last one is not really useable when working with large amounts of data, when you
> want to select i.e. 200 questions with answers it's 200*nof answers queries to get them.
Really? Wow, my opinion is that you're trying to do in one table what
you should do in two. Have a questions table, and an answers table. The
answers table would have a column specifying which question they belong
int autoincrement questionID
int autoincrement answerID
Then if you want all the answers to a question, you just grab them:
select * from answers where questionID = '100'
Or, you can do a join, and get the question information in the same query.
> The problem with the first solution is, that MyISAM storage engine is limited to 2599
> columns i think. So what's happening if i have more answers than columns available?
> Does anybody have an idea? VIEWs or GROUP_CONCAT doesn't seem to be an option, they
> are all to slow. What's the "right" way to store and select such information?
> Thank you very much.
> Fabian Köhler http://www.fabiankoehler.de