Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "sqlite3.h"
- int main() {
- sqlite3* db;
- sqlite3_open("database.db", &db);
- sqlite3_stmt* stmt;
- sqlite3_prepare_v2(db, "SELECT name1, name2 FROM tablename", -1, &stmt, NULL);
- while (sqlite3_step(stmt) == SQLITE_ROW) {
- std::cout << (char*)sqlite3_column_text(stmt, 0) << (char*)sqlite3_column_text(stmt, 1) << std::endl;
- }
- sqlite3_finalize(stmt);
- sqlite3_close(db);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement