After studying this chapter you will be able to understand: Intro to MySQL, creating database in MySQL using WAMP, connecting PHP with MySQL, inserting data in database, connections: user registration, files super global variable, file uploading in PHP, storing reference of uploaded file in database, user registration in connections web application with file upload. | 1 CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi 1 2 3 3 Writing regular expression in PHP Brackets [] Quantifiers +, *, ?, {int. range}, and $ Sub-patterns Predefined character ranges\d:\D:\w: Validating User’s Input Validating name: Validating Password: Validating date: Validating CNIC: Validating Email: Validating user’s input 4 Defined functions. preg_match(): preg_match_all(): preg_grep(): String Functions in PHP strlen(): strcmp(): strcasecmp(): strtolower(): strtoupper(): ucfirst(): ucwords(): strpos(): strrpos(): substr_count(): 5 Intro to MySQL Creating database in MySQL using WAMP Connecting PHP with MySQL Inserting data in database CONNECTIONS: user registration FILES super global variable File uploading in PHP Storing reference of uploaded file in database User registration in CONNECTIONS web application with file upload 6 6 Department of Computer Science, CIIT Islamabad. With PHP, you can connect to and manipulate databases. MySQL is the most popular database system used with PHP. 7 What is MySQL? MySQL is named after co-founder Monty Widenius's daughter: My MySQL is a database system used on the web MySQL is a database system that runs on a server MySQL is ideal for both small and large applications MySQL is very fast, reliable, and easy to use MySQL uses standard SQL MySQL compiles on a number of platforms MySQL is free to download and use The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows. 8 Go to home page of WAMP server Select PHP myadmin Login to MySql Enter database name and click create database button 9 Creating a table in a database: Select database from the list of databases Enter table name and number of columns Enter name, data-type and other required properties for columns Click create table button 10 11 localhost 12 Select phpmyadmin 13 User name is root Empty password 14 Select databases 15 Enter database name Select create 16 Select . | 1 CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi 1 2 3 3 Writing regular expression in PHP Brackets [] Quantifiers +, *, ?, {int. range}, and $ Sub-patterns Predefined character ranges\d:\D:\w: Validating User’s Input Validating name: Validating Password: Validating date: Validating CNIC: Validating Email: Validating user’s input 4 Defined functions. preg_match(): preg_match_all(): preg_grep(): String Functions in PHP strlen(): strcmp(): strcasecmp(): strtolower(): strtoupper(): ucfirst(): ucwords(): strpos(): strrpos(): substr_count(): 5 Intro to MySQL Creating database in MySQL using WAMP Connecting PHP with MySQL Inserting data in database CONNECTIONS: user registration FILES super global variable File uploading in PHP Storing reference of uploaded file in database User registration in CONNECTIONS web application with file upload 6 6 Department of Computer Science, CIIT Islamabad. With PHP, you can connect to and manipulate databases. MySQL is the most .