php-Beginners to php+sql data operation questions

Source: Internet
Author: User
Keywords PHP SQLite
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.