This script is a real world application that shows how to use MySQL with PHP. You can learn from the step by step commented php source code how to build a php program that uses MySQL to keep a database of your books. Program functions implemented include, saving a new record, listing of records for user selection, selection of a record and displaying its details, updating a record, deleting a record and searching for records. Once you have learned the techniques used in this program, you can build any php-mysql based programs.
If you are looking for a full example source codes for a complete PHP program that shows how to use PHP with MySQL, then this package is for you.
Here's what you'll learn from this package.
1. How to create and use functions in PHP
2. How to use html forms to send data to a PHP script
3. In a php script, how to properly retrieve data sent from a html form
4. How to separate php code from html and css files
5. How to display php generated data in html forms
6. How to use php include files to avoid unnecessary code duplication
7. In php functions, how to use variables defined outside the function
8. In php functions, how to pass variables into the function so that they can be used in the function
9. In php functions, how to return values of variables to the calling program.
10. In a php script, how to connect to a MySQL database, execute a query, get the query results and the number of rows returned in the query result.
11. How to dynamically fill a html form selection list with data returned from a mysql query.
12. How to use regular expressions to validate certain data inputs
13. In php script, how to redirect to another php script
14. How to avoid problems in query strings by using str_replace and addslashes
15. How to construct SQL queries that contain php variables.
16. How to use php to handle html form input errors and report them to the user.
Comments