O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

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

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 ...

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