From the course: Database Foundations: Application Development
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Add data to a database
From the course: Database Foundations: Application Development
Add data to a database
- [Narrator] PostgreSQL functions allow us to do more than just connect and send requests to the database server. There are additional functions that allow us to work with information that comes back from the server such as the results of a select query. To see this in action, scroll down on this page all the way to the bottom until you find the link to the Two Trees Olive Oil database. Alternatively, you could just browse to local host:8080/2_trees. This will open up another batch of files that we previously uploaded from the exercise files folder up into our web server. So that we have some interesting data to look at, the first script on this page will set up a sample database. It goes through a couple of different steps. The first thing that it's going to do is create a database. It does that by creating a connection, connection number one, and it uses the pg_connect function with these parameters. Then we'll set up a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
What is PHP and Apache?2m 55s
-
Create a PHP web server10m 58s
-
(Locked)
Connect to the PHP server3m 37s
-
PostgreSQL functions4m 55s
-
(Locked)
Use PHP variables3m 4s
-
(Locked)
Use if/else to handle errors4m 53s
-
(Locked)
Add data to a database4m 7s
-
(Locked)
Format SELECT query results6m 24s
-
(Locked)
Filter results with form controls5m 40s
-
(Locked)
Add data to a table with form controls5m 29s
-
(Locked)
-
-