Phpsqlite
I am a beginner, doing a homework. This is the first time I have used PHP and SQL.
Job content is the school's electronic product resources to record data, using SQLite. The page will allow the user to manipulate the data, including additions, deletions, and edits. I have done most of the functions myself, but I was pointed out that the design idea was incorrect when I was studying my code with another classmate today. I hope you can indicate whether my thinking is correct, or whether my classmates are thinking correctly.
The specific contents are as follows:
1. My train of thought:
There is a 29-column table in the database. Use the INSERT statement to add a page to the database using the Post method to get the user input, using 29 variables to get input.
2. My classmates ' ideas
Use the same post method to get user input, and then save 29 data into an array, using loops to read and store the data in the array at insert time.
The reason for the classmate is that the first use of the array does not need to define 29 variables, and secondly, as long as only the database data to operate, such code can be ported to other tables.
Trouble asking you, which of these two ideas is more correct, or which is preferable?
Thank you