Appendix B. MySQL Basics

IN THIS CHAPTER

Language Elements and Syntax

MySQL Statements

Creating a Database with phpMyAdmin

Summary

The first half of this appendix introduces you to three essential SQL operations—SELECT, INSERT, and UPDATE—and the second half of the appendix demonstrates how to use phpMyAdmin to create and manage a MySQL database within the local WAMP/MAMP environment. As usual, let’s have a quick discussion before we get into the dirty work.

A solid database administrator (DBA) can completely manage his database using a command-line interface. Having said that, anyone serious about learning SQL should probably start at the command line and switch to a GUI application only once he’s comfortable reading and hacking SQL in a terminal window.

Note

GUI MySQL applications include the favorite, MySQL Administrator, as well as MySQL Workbench, Navicat, and phpMyAdmin. Because many web hosting packages make phpMyAdmin available as an administrative tool, and further because it’s prepackaged with WAMP and MAMP, a little later we demonstrate how to use phpMyAdmin to create and modify a MySQL database.

Here’s the thinking: if you can handle SQL using the command line, you’re more likely to succeed later when you write SQL code inside functions of other languages such as PHP, which use your scripted SQL to communicate with the database. In a perfect world you’ve already covered the first few chapters of Ben Forta’s MySQL Crash Course (Sams) before ever acquiring our book. Back in reality, ...

Get Learning Flex 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.