zoukankan      html  css  js  c++  java
  • 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);

  • 相关阅读:
    grid 布局
    mongoose
    Nestjs 上传文件
    Nestjs 设置静态文件,public
    Centos 为Nginx 搭建https
    react组件
    namecheap 添加二级域名
    electron+react
    遍历文件,读取.wxss文件,在头部添加一条注释
    react 中的绑定事件
  • 原文地址:https://www.cnblogs.com/meixian/p/5371114.html
Copyright © 2011-2022 走看看