Forum und email

mysql_field_len

(PHP 4, PHP 5, PECL mysql:1.0)

mysql_field_len — Returns the length of the specified field

설명

int mysql_field_len ( resource $result , int $field_offset )

mysql_field_len()은 특정 필드의 길이를 반환한다.

매개변수

result

mysql_query() 호출을 통한 결과 resource.

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.

반환값

성공하면 특정 필드의 길이를, 실패하면 FALSE를 반환한다.

예제

Example#1 mysql_field_len() 예제

<?php
$result 
mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!
$result) {
    echo 
'Could not run query: ' mysql_error();
    exit;
}

// Will get the length of the id field as specified in the database
// schema. 
$length mysql_field_len($result0);
echo 
$length;
?>

주의

Note: 하위 호환을 위하여, 다음의 권장하지 않는 alias를 사용할 수 있습니다: mysql_fieldlen()