Join Bill Weinman for an in-depth discussion in this video Updating data in a table, part of PostgreSQL 9 with PHP Essential Training.
Updating data in your table is simply a matter of writing the SQL and…passing the data in.…We'll start by making a working copy of start.php, and we'll take a look at how…this is done in PHP.…We'll call this one update.php, and we'll open that in the text 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 the password for your SID user exactly as you…entered it in pgAdmin.…
And scrolling down here to the "database operations go here" section,…we'll start by grabbing a row using SQL.…So that will get us the row for the dog, and we'll go ahead and display it with…the message function. And we'll break out those variables from the row, starting…with the ID and the animal and the sound.…
Now once we know the ID, we can put that in a variable, and then we can update…it. And we'll do that with SQL here.…We'll use sql_do because in this case we don't have any return value.…
- 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
PHP with MySQL Beyond the Basicswith Kevin Skoglund10h 26m Intermediate
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?
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.