Creating a table

This recipe shows you how to create a simple table in a local database using a standard CREATE TABLE sentence of SQL language. Our table will have four different fields representing the data (first name, last name, e-mail, and age) of one student. This table will be called alumni. All of the fields will be declared as VARCHAR, except the age that will be an INTEGER.

We're going to display a button for creating a table, and if everything is fine, we'll launch an alert box with a message informing that the table was created. Otherwise, our box will display an error message.

All the code required for this recipe can be found at code/ch07/create_table.html in the code bundle provided on the Packtpub site.

Getting ready

As in the previous ...

Get iPhone JavaScript Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.