--查询
local sqlSelect = [[ select user_id,user_name from uums_user where user_id = '%s' ]]
local sUserId = '100'

sqlSelect = string.format(sqlSelect, sUserId)
local help= CSelectHelp();
if select(sql, '', help) < 0 then--查询
    print('error');
end

help:dumpEx('打印查询结果');--打印help结构中的数据



--插入操作
local sqlInsert = [[insert into uums_user(user_id,user_name)values('100','大象')]];
if db:execSQL(sqlInsert, '') == false then
    print('插入失败', db:error());
end



--更新操作
local sqlUpdate = [[update uums_user set user_name='大象很大' where user_id='100']];
if db:execSQL(sqlUpdate, '') == false then
    print('更新失败', db:error());
end


--删除操作
local sqlDelete = [[delete from uums_user where user_id='100']];
if db:execSQL(sqlDelete, '') == false then
    print('删除失败', db:error());
end
Copyright © TouchNet 2015 all right reserved,powered by Gitbook最后修订时间: 2022-06-21 09:21:04

results matching ""

    No results matching ""