Creating a MySQL Database
Page One: But First, a Database -->
Page Two: Data Types-->
Page Three: Using phpMyAdmin to create the
simple database-->
Page Four: Defining our Database Fields-->
Page Five: Inserting some Data into our Table-->
Inserting Data into the Table
We’re most interested in adding some actual data to our table, though. Right now, it is an empty structure. Click on the "Insert" link. Go ahead and play with the actual data. I entered the data "cat," "Himalayan," "Sherpa," "6," "sweet disposition," enter date as yyyy-mm-dd, and "sherpa.jpg" for the image name. Enter a few records, and then click the browse link to view what you’ve got.
See the insert interface in the image.
Let the Dance Begin
You now have your database, all dressed up and ready to use PHP scripts in a database driven Web page. MySQL is a deep database program, and the SQL language upon which it is based is full of features. You’ll want to go beyond the basics as you get more involved with database design. Check out the wonderful and free resource at http://www.sqlcourse.com. Here you’ll encounter a logical series of lessons, each with exercises you can practice right in your browser, with the provided online interpreter. You’ll want to learn how to join relational databases, index fields for faster queries, and other more advanced topics that we didn’t cover here.
Also, don’t forget the official MySQL Web site at http://www.mysql.org. Finally, when you want to get help with Mac OS X specific MySQL issues, the best place on the Net is Marc Liyanage’s site at http://www.entropy.ch/software/macosx/mysql.
With our foundations firmly in place, we can contemplate the upcoming beauty of the dance between our database and the PHP scripting language. Tune into the next article to join in the performance, where we’ll finally be able to put our techniques into practice.