When registered user visit certain page, I want him to be able to add some 3 column data to a database that can be retrieved for him later.

The way I see it implemented is by automatically adding an additional table in wordpress database for each registered user.

Is this the correct approach, or is there a better/more efficient way to achieve it?

  • How much information are you planning to store? Users can have meta data, just as posts can. So you can use that if the data is not too complex. If that's not an option you can add a custom post type and then save users settings as posts. If that's not ideal, you can add a custom table to wordpress, but not one table per user. Just one table, each user adds a new row to that table. – gdaniel Aug 8 '14 at 14:26
  • what if the supplied data is hundreds rows long lists of 3 column data? – Acidon Aug 8 '14 at 14:29
  • Create a relational table ID, USER_ID, CELL1, CELL2, CELL3... The you can later get the USER_ID and query all rows that match that USER_ID. – gdaniel Aug 8 '14 at 14:31
  • I see, so what if eventually that table will consist of 100k+ rows, will it affect the database speed? – Acidon Aug 8 '14 at 14:40
  • Yes. But that can happen with wordpress itself, or any database for that matter. That's when you start indexing the database and caching data. – gdaniel Aug 8 '14 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.