Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zcarter

macrumors member
Original poster
Apr 21, 2007
46
0
If i have the table 'info' in a database with just the values of a primary key and 'data'

How in the iPhone SDK could I read in from the database and loop through all of the rows in the table?

I guess my problem would be initializing the database, and then figuring out how to read in. I am very familiar with basic SQL syntax, just not the importing part of it.

Thanks,

Zac
 
There is an SQLite example program now available on the iPhone SDK website, you might want to check that out.

The way it usually works is that you issue a query to the database using a function that takes the query string as its argument. Then you provide a callback function that processes each row in the results. A callback function is just a fancy name for a function that will automatically be called for each row in the results, and the data for that row will be provided as the argument to the function so that you can process and/or store it how you want.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.