mysql_result这个函数干吗的 大家经常用“mysql_result”这个函数吗?这个函数是干吗的?我看手册半天都没有明白,大家能给我解释下马?最好举个例子说明下?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 mysql_result (PHP 3, PHP 4, PHP 5) mysql_result -- 取得结果数据 说明 mixed mysql_result ( resource result, int row [, mixed field] ) mysql_result() 返回 MySQL 结果集中一个单元的内容。字段参数可以是字段的偏移量或者字段名,或者是字段表点字段名(tablename.fieldname)。如果给列起了别名('select foo as bar from...'),则用别名替代列名。 当作用于很大的结果集时,应该考虑使用能够取得整行的函数(在下边指出)。这些函数在一次函数调用中返回了多个单元的内容,比 mysql_result() 快得多。此外注意在字段参数中指定数字偏移量比指定字段名或者 tablename.fieldname 要快得多。 调用 mysql_result() 不能和其它处理结果集的函数混合调用。 例子 1. mysql_result() 例子 <?php $link = mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error()); $result = mysql_query("SELECT name FROM work.employee") or die("Could not query: . mysql_error()); echo mysql_result($result,2); // outputs third employee's name mysql_close($link); ?> 推荐使用高性能的替代函数:mysql_fetch_row(),mysql_fetch_array(),mysql_fetch_assoc() 和 mysql_fetch_object()。 上面这段能看懂吧? mysql_result -- 取得结果数据说明mixed mysql_result ( resource result, int row [, mixed field])mysql_result() 返回 MySQL 结果集中一个单元的内容。字段参数可以是字段的偏移量或者字段名,或者是字段表点字段名(tablename.fieldname)。如果给列起了别名('select foo as bar from...'),则用别名替代列名。 当作用于很大的结果集时,应该考虑使用能够取得整行的函数(在下边指出)。这些函数在一次函数调用中返回了多个单元的内容,比 mysql_result() 快得多。此外注意在字段参数中指定数字偏移量比指定字段名或者 tablename.fieldname 要快得多。 调用 mysql_result() 不能和其它处理结果集的函数混合调用。 例子 1. mysql_result() 例子<?php $link = mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error()); $result = mysql_query("SELECT name FROM work.employee") or die("Could not query: . mysql_error()); echo mysql_result($result,2); // outputs third employee's name mysql_close($link);?> 数组存值问题 如何判断 动态生成的表格里的值是否为空 wordpress源码解析??? 请教PHP的$string配对问题 菜鸟小妹求cookies实例! 关于在新页面中提交的问题,如果post在一个新的ie窗口中,禁止复制,没有工具条 web打印的时候设置好默认打印机之后为什么还会跳出选择打印机啊? 在一个注册表上我点击“提交”,它提示“您的姓名未填”,我点击“确定”准备添,可是我还未填它就把提交的结果给提交了,为什么啦? 这个怎么不对啊?在线等!谢谢啊! rand$srand 没有安装GD库???!!! 输出不是预期值,请问,错在哪儿?
(PHP 3, PHP 4, PHP 5) mysql_result -- 取得结果数据
说明
mixed mysql_result ( resource result, int row [, mixed field] )
mysql_result() 返回 MySQL 结果集中一个单元的内容。字段参数可以是字段的偏移量或者字段名,或者是字段表点字段名(tablename.fieldname)。如果给列起了别名('select foo as bar from...'),则用别名替代列名。 当作用于很大的结果集时,应该考虑使用能够取得整行的函数(在下边指出)。这些函数在一次函数调用中返回了多个单元的内容,比 mysql_result() 快得多。此外注意在字段参数中指定数字偏移量比指定字段名或者 tablename.fieldname 要快得多。 调用 mysql_result() 不能和其它处理结果集的函数混合调用。 例子 1. mysql_result() 例子 <?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password")
or die("Could not connect: " . mysql_error()); $result = mysql_query("SELECT name FROM work.employee")
or die("Could not query: . mysql_error()); echo mysql_result($result,2); // outputs third employee's name mysql_close($link);
?> 推荐使用高性能的替代函数:mysql_fetch_row(),mysql_fetch_array(),mysql_fetch_assoc() 和 mysql_fetch_object()。
上面这段能看懂吧?
说明
mixed mysql_result ( resource result, int row [, mixed field])
mysql_result() 返回 MySQL 结果集中一个单元的内容。字段参数可以是字段的偏移量或者字段名,或者是字段表点字段名(tablename.fieldname)。如果给列起了别名('select foo as bar from...'),则用别名替代列名。 当作用于很大的结果集时,应该考虑使用能够取得整行的函数(在下边指出)。这些函数在一次函数调用中返回了多个单元的内容,比 mysql_result() 快得多。此外注意在字段参数中指定数字偏移量比指定字段名或者 tablename.fieldname 要快得多。 调用 mysql_result() 不能和其它处理结果集的函数混合调用。 例子 1. mysql_result() 例子<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password")
or die("Could not connect: " . mysql_error()); $result = mysql_query("SELECT name FROM work.employee")
or die("Could not query: . mysql_error()); echo mysql_result($result,2); // outputs third employee's name mysql_close($link);
?>