Muutke küpsiste eelistusi

Murach's PHP and MySQL (3rd Edition) 2017 3rd Enhanced edition [Pehme köide]

  • Formaat: Paperback / softback, 866 pages
  • Ilmumisaeg: 24-Oct-2017
  • Kirjastus: Mike Murach & Associates Inc.
  • ISBN-10: 1943872384
  • ISBN-13: 9781943872381
Teised raamatud teemal:
  • Formaat: Paperback / softback, 866 pages
  • Ilmumisaeg: 24-Oct-2017
  • Kirjastus: Mike Murach & Associates Inc.
  • ISBN-10: 1943872384
  • ISBN-13: 9781943872381
Teised raamatud teemal:
PHP and MySQL are two of today’s most popular, open-source tools for server-side web programming. And with this book, you’ll learn right from the start how to use them together, the way the pros do. In fact, you’ll create a database-driven website that implements the MVC pattern in the first 6 chapters! Then, the rest of the chapters show you how to build out your PHP and MySQL skills to the professional level.

PHP and MySQL are two of today’s most popular, open-source tools for server-side web programming. And with this book, you’ll learn right from the start how to use them together, the way the pros do.
Section 1: Get started fast with PHP and MySQL
Chapter 1 Introduction to web development with PHP
The architecture of a web application
4(10)
How a client-server architecture works
4(2)
How static web pages are processed
6(2)
How dynamic web pages are processed
8(2)
A survey of web application software
10(2)
Highlights in the history of PHP
12(1)
Highlights in the history of MySQL
12(2)
The Product Discount application
14(8)
The user interface
14(2)
The HTML file
16(2)
The CSS file
18(2)
The PHP file
20(2)
How to edit and test a PHP application
22(12)
How to edit a PHP page with a text editor
22(2)
How to start and stop Apache and MySQL on your own computer
24(2)
How to deploy a PHP application
26(2)
How to run a PHP application
28(2)
How to test and debug a PHP page
30(2)
How to view the source code for a web page
32(2)
How to use NetBeans to develop a PHP application
34(12)
How to work with PHP projects and files
34(2)
How to edit and test a PHP application
36(2)
How to import and configure a PHP project
38(8)
Chapter 2 How to code a PHP application
Basic PHP skills
46(8)
How to embed PHP in HTML
46(2)
How to code comments and statements
48(2)
The six PHP data types
50(2)
How to declare variables and constants
52(2)
How to get data from a request
54(4)
How to use the built-in $_GET array
54(2)
How to use the built-in $_POST array
56(1)
When to use the HTTP GET and POST methods
56(2)
How to work with data
58(10)
How to code string expressions
58(1)
How to code echo statements
58(2)
How to code numeric expressions
60(2)
How to use the compound assignment operators
62(2)
How to use some built-in functions
64(2)
How to use the filter_input() function
66(2)
The Product Discount application
68(4)
The user interface
68(1)
The form in the HTML file
68(2)
The PHP file
70(2)
How to code control statements
72(8)
How to code conditional expressions
72(2)
How to code if statements
74(2)
How to code while and for statements
76(2)
How to pass control to another page
78(2)
The Future Value application
80(8)
The user interface
80(2)
The code for the index.php file
82(2)
The code for the display_results.php file
84(4)
How to use the PHP documentation
88(8)
How to access the PHP manual
88(1)
How to find the documentation you need
88(8)
Chapter 3 Introduction to relational databases and MySQL
An introduction to relational databases
96(6)
How a database table is organized
96(2)
How the tables in a relational database are related
98(2)
How the columns in a table are defined
100(2)
The SQL statements for data manipulation
102(6)
How to select data from a single table
102(2)
How to select data from multiple tables
104(2)
How to insert, update, and delete data
106(2)
An introduction to MySQL
108(4)
What MySQL provides
108(2)
Two ways to work with MySQL
110(2)
How to use phpMyAdmin
112(14)
How to start phpMyAdmin
112(1)
How to log in, log out, and change your password
112(2)
How to import and run a SQL script that creates a database
114(2)
How to review the data and structure of a table
116(2)
How to run SQL statements
118(2)
How to create users with limited privileges
120(6)
Chapter 4 How to use PHP with a MySQL database
How to connect to a database and handle exceptions
126(4)
How to connect to a database
126(2)
How to handle exceptions
128(2)
How to get and modify data
130(8)
How to execute SELECT statements
130(2)
How to work with the first row of a result set
132(2)
How to work with all the rows of a result set
134(2)
How to execute INSERT, UPDATE, and DELETE statements
136(2)
The Product Viewer application
138(8)
The user interface
138(2)
The code
140(6)
The Product Manager application
146(14)
The user interface
146(2)
The code
148(12)
Chapter 5 How to use the MVC pattern to organize your code
How to use the MVC pattern
160(6)
An introduction to the MVC pattern
160(2)
How to code functions
162(2)
How to redirect requests
164(2)
The Product Manager application
166(14)
The user interface
166(2)
The model
168(4)
The controller
172(2)
The view
174(6)
The Product Catalog application
180(12)
The user interface
180(2)
The model
182(1)
The controller
182(2)
The view
184(8)
Chapter 6 How to test and debug a PHP application
An introduction to testing and debugging
192(6)
Typical test phases for a PHP application
192(1)
The three types of errors that can occur
192(2)
Common PHP errors
194(2)
An easy way to trace the execution of your PHP code
196(2)
How to debug with Xdebug and NetBeans
198(12)
How to set and remove breakpoints
198(2)
How to step through code
200(1)
How to inspect variables
200(2)
How to inspect the stack trace
202(8)
Section 2: Master PHP programming
Chapter 7 How to work with form data
How to get data from a form
210(14)
How to get data from text boxes, password boxes, and hidden fields
210(2)
How to get data from a radio button
212(2)
How to get data from a check box
214(2)
How to get data from an array of check boxes
216(2)
How to get data from a drop-down list
218(2)
How to get data from a list box
220(2)
How to get data from a text area
222(2)
How to display data on a web page
224(10)
How to format special characters
224(2)
How to format line breaks
226(2)
How to display data with echo and print statements
228(6)
Chapter 8 How to code control statements
How to code conditional expressions
234(6)
How to use the equality and identity operators
234(2)
How to use the relational operators
236(2)
How to use the logical operators
238(2)
How to code the selection structures
240(10)
How to code if statements with else clauses
240(2)
How to code if statements with else if clauses
242(2)
How to use the conditional and null coalesce operators
244(2)
How to code switch statements
246(2)
How to use a switch statement in the controller
248(2)
How to code the iteration structures
250(12)
How to code while loops
250(2)
How to code do-while loops
252(2)
How to code for loops
254(2)
How to use the break and continue statements
256(6)
Chapter 9 How to work with strings and numbers
How to work with strings
262(14)
How to create strings
262(2)
How to use escape sequences
264(2)
How to work with string length and substrings
266(2)
How to search a string
268(1)
How to replace part of a string
268(2)
How to modify strings
270(2)
How to convert strings to and from arrays
272(1)
How to convert strings to and from ASCII values
272(2)
How to compare strings
274(2)
How to work with numbers
276(8)
How to assign integers
276(2)
How to assign floating-point values
278(2)
How to use the math functions
280(2)
How to generate random numbers
282(2)
Other skills for working with strings and numbers
284(10)
How to use the sprintf() function to format strings and numbers
284(4)
How to convert strings to numbers
288(6)
Chapter 10 How to work with dates
How to use timestamps to work with dates
294(8)
How to create and format timestamps
294(2)
How to work with timestamps
296(2)
How to use the strtotime() function
298(2)
Examples of working with timestamps
300(2)
How to use objects to work with dates
302(12)
How to use the DateTime class
302(2)
How to use the DateInterval class
304(2)
How to use the DateInterval and DateTime classes together
306(2)
Examples of working with DateTime objects
308(6)
Chapter 11 How to create and use arrays
How to create and use an array
314(6)
How to create an array
314(2)
How to add and delete elements
316(1)
How to work with variable substitution
316(2)
How to use for loops to work with arrays
318(2)
How to create and use an associative array
320(6)
How to create an associative array
320(2)
How to add and delete elements
322(1)
How to work with variable substitution
322(2)
How to use foreach loops to work with arrays
324(2)
How to use functions to work with arrays
326(10)
How to fill, merge, slice, and splice arrays
326(2)
How to work with queues and stacks
328(2)
How to get the sum and product of elements
330(1)
How to search arrays
330(2)
How to sort arrays
332(2)
How to modify arrays
334(2)
How to work with arrays of arrays
336(4)
Understanding an array of arrays
336(2)
How to create and use an array of arrays
338(2)
The Task List Manager application
340(10)
The user interface
340(1)
The code for the controller
340(2)
The code for the view
342(8)
Chapter 12 How to work with cookies and sessions
How to work with cookies
350(6)
An introduction to cookies
350(2)
How to set and get a cookie
352(2)
How to enable or disable cookies
354(2)
How to work with sessions
356(10)
Why session tracking is difficult with HTTP
356(1)
How session tracking works in PHP
356(2)
How to start a session
358(2)
How to set and get session variables
360(2)
How to manage a session
362(2)
How to end a session
364(2)
The Shopping Cart application
366(16)
The user interface
366(2)
The controller
368(2)
The model
370(2)
The Add Item view
372(2)
The Cart view
374(8)
Chapter 13 How to create and use functions
Basic skills for working with functions
382(12)
How to create and call a function
382(2)
How to pass arguments by value and by reference
384(2)
How variable scope works
386(2)
How to provide default values for parameters
388(2)
How to work with type declarations
390(2)
How to use variable-length parameter lists
392(2)
How to create and use a library of functions
394(6)
A library of functions
394(2)
How to set the include path
396(1)
How function scope works
396(2)
How to create and use namespaces
398(2)
Advanced skills for working with functions
400(8)
How to work with variable functions and callbacks
400(2)
How to work with anonymous functions
402(4)
How to work with closures
406(2)
The Shopping Cart application
408(10)
The user interface
408(4)
The model
412(1)
The controller
413(1)
The view
413(5)
Chapter 14 How to create and use objects
How to create and use classes
418(14)
The code for the Category class
418(2)
The code for the Product class
420(4)
How to code properties
424(2)
How to code constructors and destructors
426(2)
How to code methods
428(2)
How to create and use objects
430(2)
How to code class constants, properties, and methods
432(4)
How to code class constants
432(2)
How to code static properties and methods
434(2)
The object-oriented Product Manager application
436(10)
The user interface
436(2)
The model
438(4)
The controller
442(2)
The view
444(2)
Additional skills for working with objects
446(6)
How to loop through an object's properties
446(2)
How to clone and compare objects
448(2)
How to inspect an object
450(2)
How to work with inheritance
452(14)
How to inherit a class
452(2)
How to use the protected access modifier
454(2)
How to create abstract classes and methods
456(2)
How to create final classes and methods
458(2)
How to work with interfaces
460(6)
Chapter 15 How to use regular expressions, handle exceptions, and validate data
How to use regular expressions
466(16)
How to create and use regular expressions
466(2)
How to match characters
468(2)
How to use the character class
470(2)
How to create complex patterns
472(2)
How to use look-ahead assertions
474(2)
How to use a multiline regular expression
476(1)
How to use a global regular expression
476(2)
How to replace a regular expression with a string
478(1)
How to split a string on a regular expression
478(2)
Regular expressions for data validation
480(2)
How to handle exceptions
482(6)
How to create and throw exceptions
482(2)
How to catch exceptions
484(2)
How to catch errors
486(2)
The Registration application
488(22)
The user interface
488(1)
The file structure
488(2)
The model
490(8)
The controller
498(2)
The view
500(2)
A long version of the Registration application
502(8)
Section 3: Master MySQL programming
Chapter 16 How to design a database
How to design a data structure
510(12)
The basic steps for designing a data structure
510(2)
How to identify the data elements
512(2)
How to subdivide the data elements
514(2)
How to identify the tables and assign columns
516(2)
How to identify the primary and foreign keys
518(2)
How to enforce the relationships between tables
520(2)
How normalization works
522(6)
How to identify the columns to be indexed
524(2)
How to normalize a data structure
526(1)
The seven normal forms
526(2)
How to apply, the first normal form
528(8)
How to apply the second normal form
530(2)
How to apply the third normal form
532(2)
When and how to denormalize a data structure
534(2)
A database design tool
536(8)
An introduction to MySQL Workbench
536(2)
How to use MySQL Workbench to create database diagrams
538(6)
Chapter 17 How to use SQL to create a database
How to work with databases
544(2)
How to create a database
544(1)
How to select a database
544(1)
How to drop a database
544(2)
How to work with tables
546(12)
An introduction to MySQL data types
546(2)
How to create a table
548(2)
How to code a primary key
550(2)
How to code a foreign key constraint
552(2)
How to alter a table
554(2)
How to drop a table
556(2)
How to work with indexes
558(2)
How to create an index
558(1)
How to drop an index
558(2)
How to work with users and privileges
560(10)
A summary of privileges
560(2)
How to create, rename, and drop users
562(2)
How to grant privileges
564(2)
How to revoke privileges
566(2)
How to view privileges
568(2)
Other skills for creating a database
570(4)
How to load data from text files
570(2)
How to dump a database to a SQL script
572(2)
The script for the Guitar Shop database
574(8)
Chapter 18 How to use SQL to work with a database
How to select data from a single table
582(16)
How to select columns from a table
582(2)
How to use an alias for a column
584(2)
How to select rows with a LIMIT clause
586(2)
How to select rows with a WHERE clause
588(2)
How to use the logical operators
590(2)
How to use the IS NULL operator
592(2)
How to use the LIKE operator
594(2)
How to sort rows with an ORDER BY clause
596(2)
How to select data from multiple tables
598(4)
How to code an inner join
598(2)
When and how to use table aliases
600(2)
How to code summary queries
602(4)
How to code aggregate functions
602(2)
How to group queries by column
604(2)
How to code subqueries
606(4)
Where to use subqueries
606(2)
How to code correlated subqueries
608(2)
How to insert, update, and delete rows
610(10)
How to insert rows
610(2)
How to update rows
612(2)
How to delete rows
614(6)
Chapter 19 Professional PHP for working with MySQL
Three ways to use PHP to work with MySQL
620(2)
PDO (PHP Data Objects)
620(1)
PHP's mysqli extension
620(1)
PHP's MySQL extension
620(2)
How to work with PDO
622(16)
How to connect to a database
622(1)
How to select data
622(2)
How to insert, update, and delete data
624(2)
How to work with prepared statements
626(4)
How to set the error mode for PDO
630(2)
A model in PDO
632(6)
How to work with mysqli
638(20)
How to connect to a database
638(2)
How to select data
640(2)
How to insert, update, and delete data
642(2)
How to work with prepared statements
644(4)
The object-oriented style compared to the procedural style
648(2)
A model in mysqli
650(8)
Chapter 20 A database-driven website
How to work with large text columns
658(4)
A simple content management system
658(2)
How to add HTML tags to text
660(2)
The include files for the Guitar Shop website
662(8)
The Home page
662(1)
The directory structure
662(2)
The utility files
664(1)
The view files
664(6)
The Product Catalog application
670(4)
The user interface
670(1)
The controller
670(1)
The view
670(4)
The Product Manager application
674(14)
The user interface
674(2)
The controller
676(2)
The view
678(10)
Section 4: Master the advanced skills for building websites
Chapter 21 How to create secure websites
How to use a secure connection
688(10)
An introduction to secure connections
688(2)
How SSL authentication works
690(2)
How to get a digital secure certificate
692(2)
How to request a secure connection
694(2)
How to redirect to a secure connection
696(2)
How to use authentication
698(16)
Three types of authentication
698(2)
How to store and validate a password
700(4)
How to use form-based authentication
704(6)
How to use basic authentication
710(4)
How to work with cryptography
714(10)
An introduction to four cryptography libraries
714(2)
How to install the Defuse cryptography library
716(1)
How to encrypt and decrypt data
716(2)
A class for encrypting and decrypting data
718(6)
Chapter 22 How to send email
How to send email
724(10)
How email works
724(2)
How to set up a test email account
726(2)
How to use PHPMailer to send an email
728(2)
A helper function for sending an email
730(2)
How to use the helper function to send an email
732(2)
The Registration application
734(10)
The user interface
734(2)
The controller
736(2)
The views
738(6)
Chapter 23 How to work with files, uploads, and images
How to work with files
744(10)
How to get a directory listing
744(2)
How to read and write an entire file
746(2)
How to read and write part of a file
748(2)
How to read and write CSV data
750(2)
How to copy, rename, and delete a file
752(2)
How to upload a file
754(2)
HTML for uploading a file
754(1)
PHP for working with an uploaded file
754(2)
How to work with images
756(8)
How to get information about an image
756(2)
How to read and write images
758(2)
How to resize an image
760(2)
How to work with transparency
762(2)
The Image Upload application
764(16)
The user interface
764(2)
The utility files
766(6)
The controller
772(2)
The view
774(6)
Chapter 24 An eCommerce website
An introduction to the website
780(4)
Prototyping and stepwise refinement
780(2)
The directory structure of the website
782(2)
The user interface for end users
784(8)
The Catalog application
784(2)
The Cart application
786(1)
The Checkout and Account applications
786(4)
The My Account page
790(2)
The user interface for administrators
792(10)
The Admin Login and Admin Menu pages
792(2)
The Product Manager application
794(1)
The Category Manager application
794(1)
The Order Manager application
794(1)
The Account Manager application
794
Appendix A: How to set up Windows for this book
How to install Chrome and Notepad++
802(2)
How to install the Chrome browser
802(1)
How to install Notepad++
802(2)
How to install and configure XAMPP
804(6)
How to install XAMPP
804(1)
How to set the default time zone for PHP
804(2)
How to start and stop the Apache and MySQL servers
806(2)
How to configure phpMyAdmin
808(2)
How to install the book applications and databases
810(4)
How to install the source code for this book
810(2)
How to create and restore the databases
812(2)
How to install NetBeans and Xdebug
814(4)
How to install NetBeans
814(1)
How to install Xdebug
814(4)
Appendix B: How to set up Mac OS X for this book
How to install Chrome and BBEdit
818(2)
How to install the Chrome browser
818(1)
How to install BBEdit
818(2)
How to install and configure XAMPP
820(6)
How to install XAMPP
820(1)
How to set the default time zone for PHP
820(2)
How to start and stop the Apache and MySQL servers
822(2)
How to configure phpMyAdmin
824(2)
How to install the book applications and databases
826(4)
How to install the source code for this book
826(2)
How to create and restore the databases
828(2)
How to install NetBeans and Xdebug
830(4)
How to install NetBeans
830(1)
How to install Xdebug
830(4)
Appendix C: How to set up Linux for this book
The Chrome/Chromium browser
834(4)
How to install the Chromium browser on Ubuntu
834(2)
How to install the Chrome browser on Fedora
836(2)
How to install and configure XAMPP
838(6)
How to install XAMPP
838(1)
How to set the default time zone for PHP
838(2)
How to start and stop the Apache and MySQL servers
840(1)
How to change ownership of the htdocs directory
840(2)
How to configure phpMyAdmin
842(2)
How to install NetBeans
844(4)
How to install NetBeans
844(2)
How to build and configure Xdebug
846(2)
How to install the book applications and databases
848
How to install the source code for this book
848(2)
How to create and restore the databases
850