Join Bill Weinman for an in-depth discussion in this video Inserting data into a table, part of PostgreSQL 9 with PHP Essential Training.
Inserting data into a table is accomplished with the SQL insert statement.…Let's see how this is done in a PHP script.…We are going to make a working copy, starting with the start.php file, and I am…going to name this "insert."…Open it in the editor.…Before you continue, it's important that you update the password in this file to…match the password you entered when you created the sid user in pgAdmin.…You see here on line 14 I have foo.bar.…
This is where you'll need to put a password for your sid user exactly as you…entered it in pgAdmin.…Now we see in the init function we are going ahead and creating the table, and…then in the main function I have this little marker "database operations go here."…And I am just going to replace these three lines, this foreach loop, with the…database operations for this example.…So we are going to start by inserting a row into the table.…Now you will remember that this table has a SERIAL PRIMARY KEY and id column…that's automatically incremented, and as we insert this row, we want to get a…
- Installing PostgreSQL
- Understanding database architecture
- Inserting, updating, and deleting data in a table
- Creating a database library
- Indexing ID fields
- Storing numbers, text, and Boolean values
- Reading data
- Using casts to force type
- Using mathematical functions
- Concatenating strings
- Working with date and time functions and operators
- Defining CRUD
- Using PHP to insert, read, update, and delete rows in a database
Skill Level Beginner
1. Quick Start
2. Creating a Database
3. Data Types
4. Storing and Reading Data
5. SQL Expressions
6. Mathematical Functions and Operators
Using math functions3m 2s
7. String Functions and Operators
8. Date and Time Functions and Operators
9. PHP Interfaces
10. Web Applications
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.