课程: PHP with MySQL Essential Training: 1 The Basics
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Use form data to create records
- [Instructor] In this movie, we will learn to create new records in the database by using submitted form data. Let's start by reminding ourselves what an SQL insert statement looks like. We have insert into, and then the name of the table we're using, and then in parentheses, we have a comma delimited list of the different columns we're going to be providing values for. Doesn't matter what order they're in, but the values have to correspond to the same order. And then you can see in the continuation there, we have values, and then in parentheses the different values as a competent limited list that matches the same order as the columns that we had above. So that's the SQL insert statement that we're going to be composing, and then we're going to be sending that in as our query to MySQLI query. That's different for what you're doing when we were using select, and we were asking for it to select records. Now, we're going to be using an insert. And when we're doing a insert, we're not…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。