View Single Post
Old 09-30-2012, 04:41 PM   PM User | #3
Trollypolly
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Trollypolly is an unknown quantity at this point
If you are trying to pull information from your database there are a couple of ways of doing this. You can do:

Code:
String sql = "SELECT " + select +
             		" FROM " + from +
             		" JOIN " + join +
             		" ON " + on1 + " = " + on2 +
             		" WHERE " + where +
                    " ORDER BY " + order;
             
             Cursor mCur = mDb.rawQuery(sql, null);
You can add/remove any SQL commands from my code and it should work. You will be returned a cursor which you will need to know how to gather information from aswell.

Another way of pulling information from your database is:

Code:
String table = "insertTableNameHere";  //Table name goes here
String[] = {"column1", "column2"}  //any columns you need to put, place here.

Cursor cursor = mDb.query(tableName, column, null, null, null, null, null);
If you have any questions feel free to ask.
Trollypolly is offline   Reply With Quote