| 网站首页 | JAVA文章 | AppServers | Web开发 | 应用开发 | 资源下载 |
    想学好编程,外语很重要,最新的编程技术还是在国外  [enadd  2006年12月25日]        
设为首页 加入收藏 联系站长
您现在的位置: 编程笔记网 >> 数据库 >> mysql >> mysql教程 >> 文章正文
MySQL中文参考手册---20 MySQL客户工具和API            【字体:
MySQL中文参考手册---20 MySQL客户工具和API
作者:不详    文章来源:网络    点击数:    更新时间:2007-1-21

在时间上,sql/Index.html'>mysql_eof()先于标准MySQL错误函数sql/Index.html'>mysql_errno()sql/Index.html'>mysql_error()。因为这些错误函数提供相同的信息,他们的使用更好sql/Index.html'>mysql_eof(),它现在不建议使用。(事实上,他们提供更多的信息,因为sql/Index.html'>mysql_eof()值返回一个布尔值,而错误函数指出当发生错误时的出错原因。)

20.4.10.2返回值

如果发生一个错误,零。如果到达结果集合的结束,非零。

20.4.10.3错误

无。

20.4.10.4范例

下列例子显示你必须如何使用sql/Index.html'>mysql_eof()

sql/Index.html'>mysql_query(&sql/Index.html'>mysql,"SELECT*FROMsome_table");result=sql/Index.html'>mysql_use_result(&sql/Index.html'>mysql);while((row=sql/Index.html'>mysql_fetch_row(result))){//dosomethingwithdata}if(!sql/Index.html'>mysql_eof(result))//sql/Index.html'>mysql_fetch_row()failedduetoanerror{fprintf(stderr,"Error:%s\n",sql/Index.html'>mysql_error(&sql/Index.html'>mysql));}

然而,你可以用标准MySQL错误函数完成同样的效果:

sql/Index.html'>mysql_query(&sql/Index.html'>mysql,"SELECT*FROMsome_table");result=sql/Index.html'>mysql_use_result(&sql/Index.html'>mysql);while((row=sql/Index.html'>mysql_fetch_row(result))){//dosomethingwithdata}if(sql/Index.html'>mysql_errno(&sql/Index.html'>mysql))//sql/Index.html'>mysql_fetch_row()failedduetoanerror{fprintf(stderr,"Error:%s\n",sql/Index.html'>mysql_error(&sql/Index.html'>mysql));}

20.4.11sql/Index.html'>mysql_errno()

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] 下一页  

文章录入:enadd    责任编辑:enadd 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
  • MySQL数据的导出和导入工具:…

  • mysql授课大纲

  • mysql技巧总结

  • PPTP + MPPE + RADIUS + MyS…

  • 使用函数递归实现基于php和M…

  • 基于MySQL的高性能数据库应用…

  • Mysql日期和时间函数

  • 深圳讯天 mysql 服务器错误分…

  • 几分钟让你走进mysql的门

  • 针对 Apache 2.x 的 MySQL 用…

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 管理登录 |