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

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.