How to Save the Data to Generate a PDF?

0

There is a part of the system where the user will fill in a series of information just by choosing between selects options, these selects are fed with information that I have registered in my database.

When I store this information in its proper table, should I save the text directly or should I save the ID of the elements that were selected? And why?

This information will be used later to generate a PDF that will display all the data that has been saved.

I think it would be faster to generate the PDF if I stored the texts soon, because if I store the ID I will have to do other queries to generate the right PDF? But would that be wrong in any way? Is it going to be a problem if I choose to store that certain amount of text instead of just storing the element ID?

    
asked by anonymous 20.04.2016 / 17:29

1 answer

1

Good Raylan,

That depends, will it generate a lot of network traffic? Because requesting long strings to the server, or too much text can overload your network, is not it interesting to save the ids and generate when requested?   Another detail, the database manages better indices and columns of the type longtext is not accepted in conditions of Where (at least in MySql).   My suggestion is to save the ids and generate everything when requested.

I hope I have helped.

    
20.04.2016 / 20:23