After getting an overview of the five basic steps for PHP-database interaction, learn to use mysqli_connect to connect to a database and mysqli_close to close the connection when done.
- [Instructor] In this movie,…we'll learn how to use PHP's MySQLi API…to connect to our database.…There're five fundamental steps…to getting PHP to interact with the database.…The first is that we need to create a database connection.…That's essentially like logging in to MySQL.…Once we're logged in, then we can perform a database query.…We can use the results of that query…to create whatever part of our page we need…to output the results,…or maybe just to do calculations inside PHP.…But once we done working with the data,…we can release the returned data…and finally close the database connection…or log out.…
Now, steps one and five…should only happen once for each PHP script.…You log in at the beginning,…you perform your queries,…and at the very end, you log out.…But you may repeat steps two through four…many times in a PHP script.…You would make a query on one table,…get back the data,…maybe you build part of your page,…then you turn right around…and you make another query to the database.…Maybe to a different table,…
- Organizing project files
- Including and requiring files
- Working with URL parameters
- Encoding dynamic content
- Modifying headers and page redirection
- Creating forms and processing form data
- MySQL basics
- Using PHP to access database tables
- Creating, reading, updating, and deleting database records with PHP
- Validating data
- Preventing SQL injection
Skill Level Beginner
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. Start a Database-Driven Project
2. Build Web Pages with PHP
3. Headers and Redirects
4. Build Forms with PHP
5. MySQL Basics
6. Use PHP to Access MySQL
7. CRUD with PHP
8. Validate Data with PHP
9. Prevent SQL Injection
Next steps1m 8s
- 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.