- 浏览: 229708 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
thepastsee:
304572183股票交流 欢迎加入
实时股票 -
345161974:
很不错,我第一个接触的CSS卡片布局效果,多谢
css卡片效果
转_phpcan't return a result set in the given context及参数解释
- 博客分类:
- php
关键就是两点
define('CLIENT_MULTI_RESULTS', 131072);
$link= mysql_connect("127.0.0.1","root","",1,CLIENT_MULTI_RESULTS) or die("Could not connect: ".mysql_error());
下面就可以正常使用了,以下是例子程序。
1 <?php
2 define('CLIENT_MULTI_RESULTS', 131072);
3
4 $link=mysql_connect("127.0.0.1","root","",1,CLIENT_MULTI_RESULTS)ordie("Could not connect: ".mysql_error());
5 mysql_select_db("vs")ordie("Could not select database");
6 ?>
7
8 <?php
9 $result=mysql_query("call get_news_from_class_id(2)")ordie("Query failed:".mysql_error());
10 while($row=mysql_fetch_array($result,MYSQL_ASSOC))
11 {
12 $line='<tr><td><a target = _blank href=\''.$row["url"].'\'>'.$row["title"].'('.$row["page_time"].')'.'</a></td></tr>';
14 echo$line;
15 printf(" ");
16
17 }
18 mysql_free_result($result);
19 ?>
20
21 <?php
22 mysql_close($link);
23 ?>
其中的一个参数CLIENT_MULTI_RESULTS不明白是什么意思,google之,在mysql的官方主页上关于mysql提供的c接口的文档(http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html)里找到了这个参数和其他一些参数,我大概翻译了一下描述,如下:
Flag Name Flag Description
CLIENT_COMPRESS Use compression protocol.(使用压缩协议。)
CLIENT_FOUND_ROWS Return the number of found (matched) rows, not the number of changed rows.(返回找到(匹配)的行数,而不是改变了的行数。)
CLIENT_IGNORE_SIGPIPE Prevents the client library from installing a SIGPIPE signal handler. This can be used to avoid conflicts with a handler that the application has already installed.(阻止客户端库安装一个SIGPIPE信号处理器。这个可以用于当应用程序已经安装该处理器的时候避免与其发生冲突。)
CLIENT_IGNORE_SPACE Allow spaces after function names. Makes all functions names reserved words.(允许在函数名后使用空格。所有函数名可以预留字。)
CLIENT_INTERACTIVE Allow interactive_timeout seconds (instead of wait_timeout seconds) of inactivity before closing the connection. The client's session wait_timeout variable is set to the value of the session interactive_timeout variable.(允许使用关闭连接之前的不活动交互超时的描述,而不是等待超时秒数。客户端的会话等待超时变量变为交互超时变量。)
CLIENT_LOCAL_FILES Enable LOAD DATA LOCAL handling.
CLIENT_MULTI_RESULTS Tell the server that the client can handle multiple result sets from multiple-statement executions or stored procedures. This flag is automatically enabled if CLIENT_MULTI_STATEMENTS is enabled. See the note following this table for more information about this flag.(通知服务器客户端可以处理由多语句或者存储过程执行生成的多结果集。当打开CLIENT_MULTI_STATEMENTS时,这个标志自动的被打开。可以在本表后查看更多关于该标志位的信息。)
CLIENT_MULTI_STATEMENTS Tell the server that the client may send multiple statements in a single string (separated by “;”). If this flag is not set, multiple-statement execution is disabled. See the note following this table for more information about this flag.(通知服务器客户端可以发送多条语句(由分号分隔)。如果该标志为没有被设置,多条语句执行。)
CLIENT_NO_SCHEMA Don't allow the db_name.tbl_name.col_name syntax. This is for ODBC. It causes the parser to generate an error if you use that syntax, which is useful for trapping bugs in some ODBC programs.(不允许“数据库名.表名.列名”这样的语法。这是对于ODBC的设置。当使用这样的语法时解析器会产生一个错误,这对于一些ODBC的程序限制bug来说是有用的。)
CLIENT_ODBC Unused.(不使用)
CLIENT_SSL Use SSL (encrypted protocol). This option should not be set by application programs; it is set internally in the client library. Instead, use mysql_ssl_set() before calling mysql_real_connect().(使用SSL。这个设置不应该被应用程序设置,他应该是在客户端库内部是设置的。可以在调用mysql_real_connect()之前调用mysql_ssl_set()来代替设置。)
CLIENT_REMEMBER_OPTIONS Remember options specified by calls to mysql_options(). Without this option, if mysql_real_connect() fails, you must repeat the mysql_options() calls before trying to connect again. With this option, the mysql_options() calls need not be repeated.(记住通过调用mysql_options()生成的设置。如果不使用这个设置,当mysql_real_connect失败时,再重新连接之前必须反复调用mysql_options()。当然,如果使用这个设置,就不必反复调用了。)
下面有对于CLIENT_MULTI_STATEMENTS的说明:
If you enable CLIENT_MULTI_STATEMENTS or CLIENT_MULTI_RESULTS, you should process the result for every call to mysql_query() or mysql_real_query() by using a loop that calls mysql_next_result() to determine whether there are more results. For an example, see Section 20.9.12, “C API Support for Multiple Statement Execution”.
如果打开了CLIENT_MULTI_STATEMENTS或CLIENT_MULTI_RESULTS,你必须对每一个mysql_query()或者mysql_real_query()的调用结果通过一个循环来处理,在这个循环中,调用mysql_next_result()来决定(发现)是否有更多的结果,如Section 20.9.12, “C API Support for Multiple Statement Execution”
发表评论
-
phphphphphphph
2012-03-01 22:27 0回归回归lkjlkjlkjlkjlkjlkjlkj -
php_相对路径_转
2012-03-01 22:07 0<?php $str1 = "/home/i ... -
php_自定义排序 关联数组
2012-03-01 21:11 0<?php //用PHP设计一个函数,对学生英语考试得 ... -
php_讲义
2012-02-29 13:07 0ewrwerwer -
php 禁止危险的函数_转
2012-02-27 12:28 0阿酷影 一些需要禁用的PHP危险函数 ... -
php_可以编的表格
2012-01-29 10:42 801虽 -
php_oa
2011-10-20 16:48 583dfsdfsfsf -
jquery_upload
2011-09-12 13:07 621http://fangyong2006.iteye.com/b ... -
php__表单处理
2011-08-21 17:04 790sdfadfadsf -
$_SESSION 无法跨页保存数据
2011-08-21 11:46 867今天可遇到问题 $_SESSION 无法跨页保存数据 原 ... -
php 下载地址
2011-08-13 14:51 710window http://windows.php.n ... -
订单号__14位_转
2011-06-27 23:45 816http://bbs.phpchina.com/thread- ... -
9个免费 php 库_转
2011-06-24 21:17 9509个强大免费的PHP库 & 20 你应该知道的PHP ... -
php_错误解决_sessioin
2011-06-01 16:29 1033写购物车时遇到问题, Fatal error ... -
php面试题_转
2011-05-27 01:25 744kjljk -
jquery_ajax_table_php
2011-05-27 01:04 651jljklkj -
php算法_王伟阳
2011-05-23 13:17 755232342 -
php简历
2011-05-18 00:39 1025kjlkjlkj -
黑夜路人转__
2011-05-13 21:41 709lklk -
http协议_session
2011-04-18 00:04 509kllklklk
相关推荐
所有人,包括属主、属组及其他人,用a表示 chmod 更改权限; 用法 chmod [-fR] <绝对模式> 文件 ... chmod [-fR] <符号模式列表> 文件 ... 其中 <符号模式列表> 是一个用逗号分隔的表 [ugoa]{+|-|=}[rwxXlstugo...
存储过程可以一次执行多个sql语句,所以php只连接数据库一次就能查询多个语句;不过要返回多个结果集就必须用mysqli扩展来查询,否则会提示错误can't return a result set in the given context
SQL Server never asks for SIX locks directly, they are always the result of a conversion. For example, suppose a transaction scanned a page using an S lock and then subsequently decided to perform a ...
-o [graphfile] to store the result in a file instead of displaying it -m [min_size] only consider workareas with a minimum size - pgaadvhist [-f <f_min> [<f_max>]] display the advice history for ...
Assuming the page reference does not result in an access violation, a page fault can be either hard or soft. A hard page fault results in a read from disk, either a page file or memory-mapped file. A...
In the context of the JavaMail API, your JavaMail-based program will communicate with your company or Internet Service Provider's (ISP's) SMTP server. That SMTP server will relay the message on to ...
* Using a TDBLookupComboBox to display a list of data given by a detail TQuery results in the error "Field ‘‘ not found" (Quality Central 5384 and 4823). * TDBRadioGroup maintains its ...
should be disabled, as enabling it may result in issues when generating XML ; documents, however this remains supported for backward compatibility reasons. ; Note that this directive does not control...
例如当菜单转中之后会有WM_COMMAND消息发送,WPARAM的高字中(HIWORD(wParam))是命令的ID号,对菜单来讲就是菜单ID。当然用户也可以定义自己的消息名称,也可以利用自定义消息来发送通知和传送数据。 2、谁将收到...
partial fulfillment of the requirements for the Master of Science degree in the Department of Geography. This thesis has been approved and accepted by: Date Committee in Charge: W. Andrew Marcus, ...
调用带有select语句的存储过程就出现 PROCEDURE p can’t return a result set in the given context的错误。google了半天,在mysql官网上找到一些说法,db_mysql的模块不支持存储过程调用,解决方法是...
Additionally, the function, when executed, is passed a single argument representing the position of the element in the matched set (integer, zero-index). Returning 'false' from within the each ...