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

Searching and selecting records

Retrieving records from our database is very important. Actually, we've been storing values because we need to read them back later.

To illustrate the process and find out how it works, we'll build a simple application for searching records by its first name field. Our goal will be to provide a text input where a user can type some text for finding students.

After clicking on one button, we'll execute a simple SQL query looking for the student whose first name contains the value typed by the user. The results will be displayed using an unordered list. But, what happens if an error occurs? In this case, we'll launch an alert box reporting the error.

To take a look at the file for this recipe, you can see code/ch07/select_rec.html ...

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