O'Reilly logo

Learning Flex 4 by Elijah Robison, Alaric Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix C. PHP Basics

IN THIS CHAPTER

Language Elements and Syntax

The PHP Scripts

Summary

PHP is a mature and powerful server-side scripting language, but our shallow usage of it in this book is concerned with one simple goal: bridging a Flex 4 application to a MySQL database. As such, the PHP files we present are mere outboard functions, stored on the server and waiting for the ContactManager application created in Chapter 16 and Chapter 17 to call them to either retrieve data from or submit data to a MySQL database.

The following PHP primer addresses PHP with our immediate goals in mind. First, we cover PHP basics, including the structure of a PHP file, how to declare variables, how to concatenate strings, and the ever-essential PHP MySQL functions. Once you’re familiar with the very, very basics, we discuss the actual PHP scripts we’ll use with the ContactManager application from Chapter 16 and Chapter 17.

Language Elements and Syntax

The first section of our PHP primer is concerned with the anatomy of a PHP file and the scripting essentials you’ll need to create and understand the scripts used by the ContactManager application.

PHP Files

PHP files should be appropriately named and end with the .php extension. Although PHP files can be edited using any code editor, in Appendix A we demonstrated how to add the PHP Development Tools (PDT) plug-in to your Flash Builder installation, so we expect you’ll use Flash Builder to create and edit PHP files. Within the PHP file, code is wrapped ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required