cubrid_result

(PECL CUBRID >= 8.3.0)

cubrid_resultReturn the value of a specific field in a specific row

说明

cubrid_result ( resource $result , int $row [, mixed $field = 0 ] ) : string

This function returns the value of a specific field in a specific row from a result set.

参数

result

result comes from a call to cubrid_execute()

row

The row number from the result that is being retrieved. Row numbers start at 0.

field

The name or offset of the field being retrieved. It can be the field's offset, the field's name, or the field's table dot field name (tablename.fieldname). If the column name has been aliased ('select foo as bar from...'), use the alias instead of the column name. If undefined, the first field is retrieved.

返回值

Value of a specific field, on success (NULL if value if null).

FALSE on failure.

范例

Example #1 cubrid_result() example

<?php
$conn 
cubrid_connect("localhost"33000"demodb");

$req cubrid_execute($conn"SELECT * FROM code");

$result cubrid_result($req0);
var_dump($result);

$result cubrid_result($req01);
var_dump($result);

$result cubrid_result($req5"f_name");
var_dump($result);

cubrid_close_request($req);
cubrid_disconnect($conn);
?>

以上例程会输出:

string(1) "X"
string(5) "Mixed"
string(4) "Gold"
相关文章
php cubrid mysql 兼容性函数 return the number of rows affected by the last sql statementphp cubrid mysql 兼容性函数 return the current cubrid connection charsetphp cubrid mysql 兼容性函数 move the internal row pointer of the cubrid resultphp cubrid mysql 兼容性函数 return the numerical value of the error message from previous cubrid operationphp cubrid mysql 兼容性函数 fetch a result row as an associative array a numeric array or bothphp cubrid mysql 兼容性函数 return the associative array that corresponds to the fetched rowphp cubrid mysql 兼容性函数 get column information from a result and return as an objectphp cubrid mysql 兼容性函数 return an array with the lengths of the values of each field from the current rowphp cubrid mysql 兼容性函数 fetch the next row and return it as an objectphp cubrid mysql 兼容性函数 return a numerical array with the values of the current rowphp cubrid mysql 兼容性函数 return a string with the flags of the given field offsetphp cubrid mysql 兼容性函数 get the maximum length of the specified fieldphp cubrid mysql 兼容性函数 return the name of the specified field indexphp cubrid mysql 兼容性函数 move the result set cursor to the specified field offsetphp cubrid mysql 兼容性函数 return the name of the table of the specified fieldphp cubrid mysql 兼容性函数 return the type of the column corresponding to the given field offsetphp cubrid mysql 兼容性函数 return an array with the list of all existing cubrid databasesphp cubrid mysql 兼容性函数 return the number of columns in the result setphp cubrid mysql 兼容性函数 ping a server connection or reconnect if there is no connectionphp cubrid mysql 兼容性函数 return the value of a specific field in a specific row
关注编程学问公众号