当前位置: 首页 > news >正文

网站首页图片做多大济南高新区 网站制作

网站首页图片做多大,济南高新区 网站制作,wordpress段代码,贵阳能做网站的公司gomysql###介绍gomysql是基于go-sql-driver基础上开发的orm#xff0c;这是一个轻量级的库。它会使数据库的增删改查变得非常容易。当然也是测试开发版#xff0c;会一直优化和更新#xff01;请时刻关注我们###安装go get github.com/go-sql-driver/mysqlgo get github.com…gomysql###介绍gomysql是基于go-sql-driver基础上开发的orm这是一个轻量级的库。它会使数据库的增删改查变得非常容易。当然也是测试开发版会一直优化和更新请时刻关注我们###安装go get github.com/go-sql-driver/mysqlgo get github.com/widuu/goinigo get github.com/widuu/gomysql###依赖的包###使用教程设置配置文件[database]username mysql usernamepassword mysql passwordhostname mysql hostcharset mysql charsetdatabase database nameport mysql port初始化配置c, _ : gomysql.SetConfig(./conf/conf.ini) //根据配置文件连接数据库查询数据t : c.SetTable(user) //设置要处理的表名data : t.FindOne() //查询表的一条数据返回map[int]map[string]string格式gomysql.Print(data) //打印数据信息返回如下截图的数据格式data : t.Fileds(id, password, username).Where(id 12).FindOne() //Fileds 查询字段,Where where条件FindOne()查询一条//limit sql中的limit OrderBy sql中查询的OrderBydata c.SetTable(user).Fileds(id, password, username).Where(id1).Limit(1, 5).OrderBy(id Desc).FindAll()data t.FindAll() //查询所有数据其中OrderBy() Limit() Where() Fileds()等设置条件gomysql.Print(data) //查询的数据都可以用Print()方法友好打印出来信息添加数据var value make(map[string]interface{}) //设置map存储数据map[key]valuevalue[password] mima3value[username] xiaoweivalue[id] 10t : c.SetTable(user) //设置增加的数据表t.SetPk(id) //设置主键自增的字段名称i,err : t.Insert(value) // 插入数据返回增加个数和错误信息。返回最后增长的id和错误信息修改数据var value make(map[string]interface{})value[password] mima3value[username] xiaowein, err : c.SetTable(user).Where(id 5).Update(value) //设置表条件和修改的内容返回影响条数和错误信息删除数据n, err : c.SetTable(user).Delete(id 6) //设置删除的表和数据返回影响条数和错误信息关联操作INNER JOINt : c.SetTable(user)//下面相当于sql语句打印出是Select user.id,data.keywords,user.username,user.password from user INNER JOIN data ON user.id data.iddata : t.Fileds(user.id, data.keywords, user.username, user.password).Join(data, user.id data.id).FindAll()fmt.Println(data)LEFT JOINt.Fileds(user.id, data.keywords, user.username, user.password).LeftJoin(data, user.id data.id).FindAll()fmt.Println(data)RIGHT JOINt.Fileds(user.id, data.keywords, user.username, user.password).RightJoin(data, user.id data.id).FindAll()fmt.Println(data)FULL JOINdata : t.Fileds(user.id, data.keywords, user.username, user.password).RightJoin(data, user.id data.id).FindAll()fmt.Println(data)自定义sql语句// Query()方法 是自定义sql语句的insert类型的数据n : t.Query(INSERT INTO user (username,password) VALUES (xiaoweitest,xiaowei)) //返回最后增长的idupdate|delete//updaten : c.Query(update user set usernameceshishenma where id 17 )fmt.Println(n) //1 返回受影响行数//deleten : c.Query(delete from user where id16 )fmt.Println(n) //1 返回受影响行数selectdata : c.Query(select username,password from user)fmt.Println(data) //返回map[int]map[string]string 结构的所有数据关闭数据库c.DbClose() //关闭数据库##English Document###IntroductionGomysql is based on the go - SQL - driver based on orm, this is a lightweight library.It allows the database to add delete very easily.Of course is also testing the development version, will continue to optimize and update!Please attention to us###Installgo get github.com/widuu/gomysql###Rely on the package###Using the tutorialSet the configuration file[database]username mysql usernamepassword mysql passwordhostname mysql hostcharset mysql charsetdatabase database nameport mysql portInitialize the configurationc, _ : gomysql.SetConfig(./conf/conf.ini) //According to the configuration files, connect to the databaseQuery datat : c.SetTable(user) //set up the table namedata : t.FindOne() //A data queryreturn map[int]map[string]string formatgomysql.Print(data) //Print data information, and return the following screenshots data formatsdata : t.Fileds(id, password, username).Where(id 12).FindOne() //Fileds Query field,Where where conditions FindOne() query a data//limit - sql limit,OrderBy - sql OrderBydata c.SetTable(user).Fileds(id, password, username).Where(id1).Limit(1, 5).OrderBy(id Desc).FindAll()data t.FindAll() //Query all the data, including OrderBy () Limit () the Where () Fileds () set conditionsgomysql.Print(data) //Query data can use the Print () method of friendly printed informationInsert datavar value make(map[string]interface{}) //Set the map data is stored, the map [key] the valuevalue[password] mima3value[username] xiaoweivalue[id] 10t : c.SetTable(user) //Set up to increase the data tablest.SetPk(id) //Set the primary key on the field namei,err : t.Insert(value) // Insert data, returns the number increase and error information.Returns the last growth id and error messageUpdata datavar value make(map[string]interface{})value[password] mima3value[username] xiaowein, err : c.SetTable(user).Where(id 5).Update(value) //Set the table, the condition and modify the content of the article returns affect the number and the error informationDelete datan, err : c.SetTable(user).Delete(id 6) //Article, set the table and data delete, return to influence the number and the error informationAssociated operationINNER JOINt : c.SetTable(user)//Equivalent to a SQL statement below, print out is//Select user.id,data.keywords,user.username,user.password from user INNER JOIN data ON user.id data.iddata : t.Fileds(user.id, data.keywords, user.username, user.password).Join(data, user.id data.id).FindAll()fmt.Println(data)LEFT JOINt.Fileds(user.id, data.keywords, user.username, user.password).LeftJoin(data, user.id data.id).FindAll()fmt.Println(data)RIGHT JOINt.Fileds(user.id, data.keywords, user.username, user.password).RightJoin(data, user.id data.id).FindAll()fmt.Println(data)FULL JOINdata : t.Fileds(user.id, data.keywords, user.username, user.password).RightJoin(data, user.id data.id).FindAll()fmt.Println(data)自定义sql语句// Query()function Is a custom SQL statementinsertn : t.Query(INSERT INTO user (username,password) VALUES (xiaoweitest,xiaowei)) //Return the id of the growthupdate|delete//updaten : c.Query(update user set usernameceshishenma where id 17 )fmt.Println(n) //1 Return the affected rows//deleten : c.Query(delete from user where id16 )fmt.Println(n) //1 Return the affected rowsselectdata : c.Query(select username,password from user)fmt.Println(data) //return map[int]map[string]string All of the data structureClose the databasec.DbClose() //close the database
http://www.zqtcl.cn/news/421923/

相关文章:

  • 大连网站设计案例宁波品牌网站设计价格
  • 响应式表白网站源码黑龙江建设网电话
  • wordpress企业建站生产企业做网站的费用怎么做账
  • 天都城网站建设wordpress pluings
  • 惠州做网站的公司有哪些wordpress主动推送
  • jsp做的网站带数据库新手网站设计定价
  • 做网站公司需要什么条件不锈钢公司网站源码 网站建设 产品3级分类asp源码
  • 经营网站挣钱网络运维工程师证书怎么考
  • 厦门网站建设ui株洲企业网站制作
  • 创建个网站需要多少钱张家界seo优化方案
  • 深圳营销型网站建设公司哪家好熊岳网站怎么做
  • 邢台企业网站建设好么找公司做网站要注意什么问题
  • 做博客网站要怎么配置的服烟台app开发公司
  • 从化网站建设方案怎么注册公司名字
  • 网站建设需要哪些书籍免费做游戏网站
  • 杭州 网站定制做旅游网站宣传
  • 泉州市做网站优化建设地情网站的作用
  • 筑巢网络官方网站打开搜索引擎
  • 赣州做网站公司哪家好网站先做前端还是后台
  • wordpress关闭网站吗用织梦做的学校网站
  • 响应式网站建设平台东莞网站建设aj
  • 代码做网站的软件市场营销策划书
  • 东莞网站建设 手机壳文登建设局网站
  • 网站建设和后台空间管理关系企业网络需求分析
  • 做小说网站做国外域名还是国内的好温州市网站建设
  • wordpress识别手机跳转网站3d视频动画制作
  • 展示型企业网站设计方案邯郸市口碑网络技术有限公司
  • 网站配色案例泰州seo平台
  • wordpress标题title优化代码seo技术顾问
  • 怎么做直播网站的超管延安免费做网站