略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: cubrid_result

2024-12-22

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.

范例

示例 #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"
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.cubrid-result.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3