cubrid_field_seek

(PECL CUBRID >= 8.3.0)

cubrid_field_seekMove the result set cursor to the specified field offset

Description

cubrid_field_seek(resource $result, int $field_offset = 0): bool

This function moves the result set cursor to the specified field offset. This offset is used by cubrid_fetch_field() if it doesn't include a field offset. It returns TRUE on success or FALSE on failure.

Parameters

result

result comes from a call to cubrid_execute()

field_offset

The numerical field offset. The field_offset starts at 0. If field_offset does not exist, an error of level E_WARNING is also issued.

Return Values

true on success.

false on failure.

Examples

Example #1 cubrid_field_seek() example

<?php
$conn 
cubrid_connect("localhost"33000"demodb");
$req cubrid_execute($conn"SELECT event_code,athlete_code,nation_code,game_date FROM game WHERE host_year=1988 and event_code=20001;");

var_dump(cubrid_fetch_row($req));

cubrid_field_seek($req1);
$field cubrid_fetch_field($req);

printf("\n--- Field Properties ---\n");
printf("%-30s %s\n""name:"$field->name);
printf("%-30s %s\n""table:"$field->table);
printf("%-30s \"%s\"\n""default value:"$field->def);
printf("%-30s %d\n""max length:"$field->max_length);
printf("%-30s %d\n""not null:"$field->not_null);
printf("%-30s %d\n""unique key:"$field->unique_key);
printf("%-30s %d\n""multiple key:"$field->multiple_key);
printf("%-30s %d\n""numeric:"$field->numeric);
printf("%-30s %s\n""type:"$field->type);

cubrid_close_request($req);

cubrid_disconnect($conn);
?>

The above example will output:

array(4) {
  [0]=>
  string(5) "20001"
  [1]=>
  string(5) "16132"
  [2]=>
  string(3) "KOR"
  [3]=>
  string(9) "1988-09-30"
}

--- Field Properties ---
name:                          athlete_code
table:                         game
default value:                 ""
max length:                    0
not null:                      1
unique key:                    1
multiple key:                  0
numeric:                       1
type:                          integer

Here you can write a comment


Please enter at least 10 characters.
Loading... Please wait.
* Pflichtangabe
There are no comments available yet.

Midjourney Tutorial - Instructions for beginners

There is an informative video about Midjourney, the tool for creating digital images using artificial intelligence, entitled "Midjourney tutorial in German - instructions for beginners" ...

Mike94

Autor : Mike94
Category: KI Tutorials

Basics of views in MySQL

Views in a MySQL database offer the option of creating a virtual table based on the result of an SQL query. This virtual table can be queried like a normal table without changing the underlying data. ...

admin

Autor : admin
Category: mySQL-Tutorials

Definition of stored procedures - an introduction

Stored procedures are predefined SQL code blocks that are stored in a database and can be called up as required. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Category: mySQL-Tutorials

Publish a tutorial

Share your knowledge with other developers worldwide

Share your knowledge with other developers worldwide

You are a professional in your field and want to share your knowledge, then sign up now and share it with our PHP community

learn more

Publish a tutorial