Muutke küpsiste eelistusi

Murach's PHP and MySQL (4th Edition) 4th New edition [Pehme köide]

  • Formaat: Paperback / softback, 848 pages, 360 illus
  • Ilmumisaeg: 15-Aug-2022
  • Kirjastus: Mike Murach & Associates Inc.
  • ISBN-10: 1943873003
  • ISBN-13: 9781943873005
  • Formaat: Paperback / softback, 848 pages, 360 illus
  • Ilmumisaeg: 15-Aug-2022
  • Kirjastus: Mike Murach & Associates Inc.
  • ISBN-10: 1943873003
  • ISBN-13: 9781943873005
Murach’s PHP and MySQL (4th Edition) delivers the skills you need to develop database-driven websites using PHP and MySQL. You’ll quickly learn to code the way today’s top web professionals do, even without any prior coding experience. Each section features clear, beginner-friendly examples and easy-to-understand explanations that walk you through crucial skills, best practices, and helpful tips.Section 1 is a quick-start course that shows how to use the latest versions of PHP, MySQL, and the Apache web server to build your first PHP applications. Right from the start, you’ll learn to create applications that conform to the industry-standard Model-View-Controller (MVC) pattern, so they’ll be easy to maintain as they grow. In addition, you’ll learn how to create secure applications that prevent SQL injection attacks and guard against XSS attacks.Section 2 dives deeper into PHP by covering the skills you’ll use every day, like how to work with form data, cookies, functions, and objects. Then, section 3 dives deeper into MySQL, teaching you how to design, create, and work with a database. Finally, section 4 teaches you important web programming skills like how to secure web pages, upload files, and process images.Along the way, you’ll learn how to take advantage of PHP 8 enhancements like match expressions, constructor property promotion, and the nullsafe operator, ensuring your skills are up to date.Like all Murach books, Murach’s PHP and MySQL guarantees high quality, and developers love our “code that actually works.” See why for yourself, with a complete website to study and practice exercises for hands-on experience. You’ll have a hard time finding such effective examples anywhere else.
Section 1 Get started fast with PHP and MySQL
Chapter 1 Introduction to web development with PHP
The architecture of a web application
4(1)
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(1)
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(1)
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(1)
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(1)
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(1)
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(1)
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(1)
The user interface
68(1)
The form in the HTML file
68(2)
The PHP file
70(2)
How to code control statements
72(1)
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(1)
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(1)
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(1)
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(1)
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(1)
What MySQL provides
108(2)
Two ways to work with MySQL
110(2)
How to use phpMyAdmin
112(1)
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(1)
How to connect to a database
126(2)
How to handle exceptions
128(2)
How to get and modify data
130(1)
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(1)
The user interface
138(2)
The code
140(6)
The Product Manager application
146(1)
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(1)
An introduction to the MVC pattern
160(2)
How to code functions
162(2)
How to redirect requests
164(2)
How to use the Post-Redirect-Get pattern
166(2)
The Product Manager application
168(1)
The user interface
168(2)
The model
170(4)
The controller
174(2)
The views
176(6)
The Product Catalog application
182(1)
The user interface
182(2)
The model
184(1)
The controller
184(2)
The views
186(8)
Chapter 6 How to test and debug a PHP application
An introduction to testing and debugging
194(1)
Typical test phases for a PHP application
194(1)
The three types of errors that can occur
194(2)
Common PHP errors
196(2)
An easy way to trace the execution of your PHP code
198(2)
How to debug with Xdebug and NetBeans
200(1)
How to set and remove breakpoints
200(2)
How to step through code
202(1)
How to inspect variables
202(2)
How to inspect the stack trace
204(8)
Section 2 Master PHP programming
Chapter 7 How to work with form data
How to get data from a form
212(1)
How to get data from text boxes, password boxes, and hidden fields
212(2)
How to get data from a radio button
214(2)
How to get data from a check box
216(2)
How to get data from an array of check boxes
218(2)
How to get data from a drop-down list
220(2)
How to get data from a list box
222(2)
How to get data from a text area
224(2)
How to display data on a web page
226(1)
How to format special characters
226(2)
How to format line breaks
228(2)
How to display data with echo and print statements
230(6)
Chapter 8 How to code control statements
How to code conditional expressions
236(1)
How to use the equality and identity operators
236(2)
How to use the relational operators
238(2)
How to use the logical operators
240(2)
How to code the selection structures
242(1)
How to code if statements with else clauses
242(2)
How to code if statements with else if clauses
244(2)
How to use the conditional operator
246(2)
How to use the null coalescing operators
248(2)
How to code switch statements
250(2)
How to code match expressions
252(2)
How to use a switch statement in the controller
254(2)
How to code the iteration structures
256(1)
How to code while loops
256(2)
How to code do-while loops
258(2)
How to code for loops
260(2)
How to use the break and continue statements
262(6)
Chapter 9 How to work with strings and numbers
How to work with strings
268(1)
How to create strings
268(2)
How to use escape sequences
270(2)
How to work with string length and substrings
272(2)
How to search a string
274(2)
How to modify strings
276(2)
How to convert strings to and from arrays
278(1)
How to convert strings to and from ASCII values
278(2)
How to compare strings
280(2)
How to work with numbers
282(1)
How to assign integers
282(2)
How to assign floating-point values
284(2)
How to use the math functions
286(2)
How to generate random numbers
288(2)
Other skills for working with strings and numbers
290(1)
How to use the sprintf() function to format strings and numbers
290(4)
How to convert strings to numbers
294(6)
Chapter 10 How to work with dates
Two ways to work with dates and times
300(1)
An introduction to timestamps
300(1)
An introduction to DateTime objects
300(2)
How to use objects to work with dates
302(1)
How to create a DateTime object
302(2)
How to modify and validate a DateTime object
304(2)
How to format a DateTime object
306(2)
How to create and format a Datelnterval object
308(2)
How to use Datelnterval and DateTime objects together
310(2)
Examples of working with DateTime objects
312(6)
Chapter 11 How to create and use arrays
How to create and use an array
318(1)
How to create an array
318(2)
How to add and delete elements
320(1)
How to work with variable substitution
320(2)
How to use for loops to work with arrays
322(2)
How to create and use an associative array
324(1)
How to create an associative array
324(2)
How to add and delete elements
326(1)
How to work with variable substitution
326(2)
More skills for working with arrays
328(1)
How to use foreach loops to work with arrays
328(2)
How to work with the spread operator
330(2)
How to use functions to work with arrays
332(1)
How to fill, merge, slice, and splice arrays
332(2)
How to check if a variable is an array
334(1)
How to work with queues and stacks
334(2)
How to get the sum and product of elements
336(1)
How to search arrays
336(2)
How to sort arrays
338(2)
How to modify arrays
340(2)
How to work with arrays of arrays
342(1)
Understanding an array of arrays
342(2)
How to create and use an array of arrays
344(2)
The Task List Manager application
346(1)
The user interface
346(1)
The code for the controller
346(2)
The code for the view
348(8)
Chapter 12 How to work with cookies and sessions
How to work with cookies
356(1)
An introduction to cookies
356(2)
How to set and get a cookie
358(2)
How to enable or disable cookies
360(2)
How to work with sessions
362(1)
Why session tracking is difficult with HTTP
362(1)
How session tracking works in PHP
362(2)
How to start a session
364(2)
How to set and get session variables
366(2)
How to manage a session
368(2)
How to end a session
370(2)
The Shopping Cart application
372(1)
The user interface
372(2)
The controller
374(2)
The model
376(2)
The Add Item view
378(2)
The Cart view
380(8)
Chapter 13 How to create and use functions
Basic skills for working with functions
388(1)
How to create a function
388(2)
How to call a function
390(2)
How to pass arguments by value and by reference
392(2)
How variable scope works
394(2)
How to use optional parameters
396(1)
How to use named arguments
396(2)
How to work with type declarations
398(2)
How to use variable-length parameter lists
400(2)
How to create and use a library of functions
402(1)
A library of functions
402(2)
How to set the include path
404(1)
How function scope works
404(2)
How to create and use namespaces
406(2)
Advanced skills for working with functions
408(1)
How to work with variable functions and callbacks
408(2)
How to work with anonymous functions
410(2)
How to work with arrow functions
412(2)
How to work with closures
414(2)
The Shopping Cart application
416(1)
The user interface
416(2)
The model
418(2)
The controller
420(1)
The view
420(8)
Chapter 14 How to create and use objects
How to create and use classes
428(1)
The code for the Category class
428(2)
The code for the Product class
430(4)
How to code properties
434(2)
How to code constructors and destructors
436(2)
How to use constructor property promotion
438(2)
How to code methods
440(2)
How to create and use objects
442(2)
How to code class constants, properties, and methods
444(1)
How to code class constants
444(2)
How to code static properties and methods
446(2)
How to work with enums
448(1)
How to work with pure enums
448(1)
How to work with backed enums
448(2)
The object-oriented Product Manager application
450(1)
The user interface
450(2)
The model
452(4)
The controller
456(2)
The view
458(2)
Additional skills for working with objects
460(1)
How to loop through an object's properties
460(2)
How to clone and compare objects
462(2)
How to inspect an object
464(2)
How to work with inheritance
466(1)
How to inherit a class
466(2)
How to use the protected access modifier
468(2)
How to create abstract classes and methods
470(2)
How to create final classes, methods, and constants
472(2)
How to work with interfaces
474(8)
Chapter 15 How to use regular expressions, handle exceptions, and validate data
How to use regular expressions
482(1)
How to create and use regular expressions
482(2)
How to match characters
484(2)
How to use the character class
486(2)
How to create complex patterns
488(2)
How to use look-ahead assertions
490(2)
How to use a multiline regular expression
492(1)
How to use a global regular expression
492(2)
How to replace a regular expression with a string
494(1)
How to split a string on a regular expression
494(2)
Regular expressions for data validation
496(2)
How to handle exceptions and errors
498(1)
How to create and throw exceptions
498(2)
How to catch exceptions
500(2)
How to catch errors
502(2)
The Registration application
504(1)
The user interface
504(1)
The file structure
504(2)
The model
506(6)
The controller
512(2)
The view
514(2)
A long version of the Registration application
516(8)
Section 3 Master MySQL programming
Chapter 16 How to design a database
How to design a data structure
524(1)
The basic steps for designing a data structure
524(2)
How to identify the data elements
526(2)
How to subdivide the data elements
528(2)
How to identify the tables and assign columns
530(2)
How to identify the primary and foreign keys
532(2)
How to enforce the relationships between tables
534(2)
How normalization works
536(2)
How to identify the columns to be indexed
538(2)
How to normalize a data structure
540(1)
The seven normal forms
540(2)
How to apply the first normal form
542(2)
How to apply the second normal form
544(2)
How to apply the third normal form
546(2)
When and how to denormalize a data structure
548(6)
Chapter 17 How to use SQL to create a database
How to work with databases
554(1)
How to create a database
554(1)
How to select a database
554(1)
How to drop a database
554(2)
How to work with tables
556(1)
An introduction to MySQL data types
556(2)
How to create a table
558(2)
How to code a primary key
560(2)
How to code a foreign key constraint
562(2)
How to alter a table
564(2)
How to drop a table
566(2)
How to work with indexes
568(1)
How to create an index
568(1)
How to drop an index
568(2)
How to work with users and privileges
570(1)
A summary of privileges
570(2)
How to work with users
572(2)
How to grant privileges
574(2)
How to revoke privileges
576(2)
How to view privileges
578(2)
Other skills for creating a database
580(1)
How to load data from text files
580(2)
How to dump a database to a SQL script
582(2)
The script for the Guitar Shop database
584(8)
Chapter 18 How to use SQL to work with a database
How to select data from a single table
592(1)
How to select columns from a table
592(2)
How to use an alias for a column
594(2)
How to select rows with a LIMIT clause
596(2)
How to select rows with a WHERE clause
598(2)
How to use the logical operators
600(2)
How to use the IS NULL operator
602(2)
How to use the LIKE operator
604(2)
How to sort rows with an ORDER BY clause
606(2)
How to select data from multiple tables
608(1)
How to code an inner join
608(2)
When and how to use table aliases
610(2)
How to code summary queries
612(1)
How to code aggregate functions
612(2)
How to group queries by column
614(2)
How to code subqueries
616(1)
Where to use subqueries
616(2)
How to code correlated subqueries
618(2)
How to insert, update, and delete rows
620(1)
How to insert rows
620(2)
How to update rows
622(2)
How to delete rows
624(6)
Chapter 19 Professional PHP for working with MySQL
Three ways to use PHP to work with MySQL
630(1)
PDO (PHP Data Objects)
630(1)
PHP's mysqli extension
630(1)
PHP's MySQL extension
630(2)
How to work with PDO
632(1)
How to connect to a database
632(1)
How to select data
632(2)
How to insert, update, and delete data
634(2)
How to work with prepared statements
636(4)
How to set the error mode for PDO
640(2)
A model in PDO
642(6)
How to work with mysqli
648(1)
How to connect to a database and check for errors
648(2)
How to select data
650(2)
How to insert, update, and delete data
652(2)
How to work with prepared statements
654(4)
The object-oriented style compared to the procedural style
658(2)
A model in mysqli
660(10)
Chapter 20 A database-driven website
How to work with large text columns
670(1)
A simple content management system
670(2)
How to add HTML tags to text
672(2)
The include files for the Guitar Shop website
674(1)
The Home page
674(1)
The directory structure
674(2)
The utility files
676(1)
The view files
676(6)
The Product Catalog application
682(1)
The user interface
682(1)
The controller
682(1)
The view
682(4)
The Product Manager application
686(1)
The user interface
686(2)
The controller
688(2)
The view
690(10)
Section 4 Master the advanced skills for building websites
Chapter 21 How to create secure websites
How to use a secure connection
700(1)
An introduction to secure connections
700(2)
How SSL authentication works
702(2)
How to get a digital secure certificate
704(2)
How to request a secure connection
706(2)
How to redirect to a secure connection
708(2)
How to use authentication
710(1)
Three types of authentication
710(2)
How to store and validate a password
712(4)
How to use form-based authentication
716(10)
Chapter 22 How to work with files, uploads, and images
How to work with files
726(1)
How to get a directory listing
726(2)
How to read and write an entire file
728(2)
How to read and write part of a file
730(2)
How to copy, rename, and delete a file
732(2)
How to upload a file
734(1)
HTML for uploading a file
734(1)
PHP for working with an uploaded file
734(2)
How to work with images
736(1)
How to get information about an image
736(2)
How to read and write images
738(2)
How to resize an image
740(2)
How to work with transparency
742(2)
The Image Upload application
744(1)
The user interface
744(2)
The utility files
746(6)
The controller
752(2)
The view
754(6)
Chapter 23 An eCommerce website
An introduction to the website
760(1)
Prototyping and stepwise refinement
760(2)
The directory structure of the website
762(2)
The user interface for end users
764(1)
The Catalog application
764(2)
The Cart application
766(1)
The Checkout and Account applications
766(4)
The My Account page
770(2)
The user interface for administrators
772(1)
The Admin Login and Admin Menu pages
772(2)
The Product Manager application
774(1)
The Category Manager application
774(1)
The Order Manager application
774(1)
The Account Manager application
774(8)
Appendix A How to set up Windows for this book
How to install Chrome and Notepad++
782(1)
How to install Chrome
782(1)
How to install Notepad++
782(2)
How to install and configure XAMPP
784(1)
How to install XAMPP
784(1)
How to configure PHP
784(2)
How to start and stop the Apache and MySQL servers
786(2)
How to configure phpMyAdmin
788(2)
How to install the book applications and databases
790(1)
How to install the source code for this book
790(2)
How to create and restore the databases
792(2)
How to install NetBeans and Xdebug
794(1)
How to install NetBeans
794(2)
How to install Xdebug
796(4)
Appendix B How to set up macOS for this book
How to install Chrome and Atom
800(1)
How to install Chrome
800(1)
How to install Atom
800(2)
How to install and configure XAMPP
802(1)
How to install XAMPP
802(1)
How to configure PHP
802(2)
How to start and stop the Apache and MySQL servers
804(2)
How to configure phpMyAdmin
806(2)
How to install the book applications and databases
808(1)
How to install the source code for this book
808(2)
How to create and restore the databases
810(2)
How to install NetBeans and Xdebug
812(1)
How to install NetBeans
812(2)
How to install Xdebug
814