PHP and MySQL 24-Hour Trainer

PHP and MySQL 24-Hour Trainer

Andrea Tarr

Language: English

Pages: 504

ISBN: 111806688X

Format: PDF / Kindle (mobi) / ePub


Step-by-step lessons for using PHP and MySQL in a unique book-and-video combination

Assuming no previous experience with PHP or MySQL, this book-and-video package is ideal reading for anyone who wants to go beyond HTML/CSS in order to provide clients with the most dynamic web sites possible. The approachable tone breaks down the basics of programming and PHP and MySQL in individual lessons starting with the installation of the programs necessary to run PHP. You begin with a static web site and then watch and learn as PHP functionality is added as you work through the lessons.

When working with databases, the MySQL database is introduced with demonstrations that show how to interact with it. The accompanying videos enhance your learning experience, as each lesson in the book is portrayed in the video exercises.

Lessons include:
? Getting started with PHP
? Setting up your workspace
? Adding PHP to a web page
? Learning PHP syntax 
? Working with variables
? Debugging code 
? Working with complex data
? Making decisions
? Repeating program steps
? Learning about scope
? Reusing code with functions
? Creating forms
? Introducing object-oriented programming
? Defining classes
? Using classes
? Using advanced techniques
? Handling errors
? Writing secure code
? Introducing databases
? Introducing MySQL
? Creating and connecting to the
? Creating tables
? Entering data
? Selecting data
? Using multiple tables
? Changing data
? Deleting data
? Preventing database security issues
? Creating user logins
? Turn the case study into a content management system

Note: As part of the print version of this title, video lessons are included on DVD. For e-book versions, video lessons can be accessed at wrox.com using a link provided in the interior of the e-book.

The Reflective Practitioner: How Professionals Think In Action

Professional Hadoop Solutions

Introduction to Automata Theory, Languages, and Computation (2nd Edition)

McGraw-Hill's GMAT (2013 Edition)

Encyclopedia of Wood (Art of Woodworking)

 

 

 

 

 

 

 

 

 

 

 

 

 

use continue if you are done with a particular loop iteration and want to jump to the start of the next iteration. In the following example, the email value is skipped:

Contact

‘George Smith’, ‘email’ => ‘george@example.com’, ‘phone’ => ‘555-555-1212’, ‘state’ => ‘MA’); ?>

    $value) : if ($key == ‘email’) : continue; endif; ?>
  • :

If you

as a way to make dynamic websites by generating HTML. Today it stands on its own as a generalpurpose programming language and is available on most web hosting sites. Because of its roots, it is very easy to insert bits and pieces of PHP inside of standard HTML/XHTML code. MySQL is a popular relational database management system. It is the standard database system available on web hosting sites. Although it works with many different programming languages, it is frequently paired with PHP. WHO

need to also call the function, as shown in the following code. See Figure 10-1.

Contacts

FIGURE 10-1 You see that the code in the function is not processed when you defi ne it in the function. It is only when you call the function that “George Smith” is displayed. After you have defi ned the function you can call it as often as you need it. So if you had a need to echo out George’s name

three times, you could do it this way (see Figure 10-2): c10.indd 126 FIGURE 10-2 10/3/2011 12:54:00 PM Tarr 10.indd V2 - 09/22/2011 Page 127 Passing Parameters x 127

Contacts

Each time you run a function, the variables in your function are new variables. If you change the value of a variable in a function, that change does not

contacts * @param string $newname * @param string $newnumber */ public function addThenDisplayContacts($newname, $newnumber) { $this->addContacts($newnumber, $newname); $this->displayContacts(); } /** * Count the songs * @return int */ public function countSongs() { $result = count($this->songs); return $result; } } You have learned how to defi ne a class. In the next lesson you learn how to use this class. TRY IT In this Try It, you create a class for the contacts in the Case Study. A contact

Download sample

Download