I have a file named discussion.php, where a form is located. In this form, a user will enter information, and the information will be posted to savedisc.php. Below is the code for discussion.php:
<form action='savedisc.php' method='post'>
<p>What would you like to discuss?</p>
<textarea name='message' rows='15' cols='40'></textarea>
<input type='submit' value='Submit' />
</form>
Once the user hits the submit button, the text that the user had typed should be saved via savedisc.php. I.e. I will connect to the database, and save what the user had typed in textarea.
Now to display the information that the user had typed in the textarea, I will connect to the database in another file, and show the appropriate content.
Some of my questions are: Should I not save it in the database? Because later on I might have enormous amounts of data in my tables. Is there another way to display information submitted by a user without the use of saving to the database? Or am I doing OKAY? For example, the question I am about to post right now, is it actually saved in a database?
Thank you.
Databases are meant to store large amount of data and handle large amount of transactions. So, definitely yes.
But if you’re thinking of optimizing your database and save some resources, you can store the data the user just entered and show it without requesting it again from the database, like when you ask a question and it shows it to you again on Stack Overflow, you’d have one less transaction.
So, for example in your
savedisc.php