• SQLite 粗劣内容


    SQLite 的官网

    http://addons.mozillan.org/firefox/addon/sqlite-manager/

    http://www.sqlite.org

     

    sqlite3 *sqlite = nil;

        

        NSString *filePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/data.file" ];

        

        //打开数据库

        int result  = sqlite3_open([filePath  UTF8String], &sqlite);

        if (result !=SQLITE_OK) {

            NSLog(@"创建失败!!!");

            return ;

        }

        

        //创建表的SQL语句

        

        NSString *sql = @"CREATE TABLE IF NOT EXISTS UserTable(userName text PRIMARY KEY ,password text,email text)";

        //执行SQL语句

        char *error;

        result = sqlite3_exec(sqlite, [sql  UTF8String], NULL, NULL, &error);

        if (result != SQLITE_OK) {

            NSLog(@"创建数据库失败:%s",error);

            return ;

        }

        //插如入一条数据

        //INSERT OR REPLACE INTO UserTable (userName,password,email) VALUES(?,?,?);

        //更新一条数据

        //UPDATE UserTable set password = '' where userName = '';

        

        //查询数据

        

        //SELECT userName ,password,eamil FROM UserTable where username = '';

       

        //删除数据

       // DELETE FROM UserTable WHERE username ='';

        

        //关闭数据库

        

        sqlite3_close(sqlite);

  • 相关阅读:
    [转载红鱼儿]delphi 实现微信开发(1)
    Devexpress VCL Build v2013 vol 14.1.3 发布
    [翻译]LSP程序的分类
    睡眠不好
    LuaStudio 9.27 去10分钟退出暗桩板
    vs2012 提示 未能正确加载 "Visual C++ Language Manager Package" 包 的解决办法
    岁月蹉跎
    重新安装系统之前备份
    运动会
    乱思
  • 原文地址:https://www.cnblogs.com/meixian/p/5371114.html
Copyright © 2020-2023  润新知