downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mysql_field_name> <mysql_field_flags
Last updated: Fri, 24 Jul 2009

view this page in

mysql_field_len

(PHP 4, PHP 5)

mysql_field_len지정한 필드의 길이를 반환

설명

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;
}

// 데이터베이스 스키마에 지정된
// id 필드의 길이를 얻습니다.
$length mysql_field_len($result0);
echo 
$length;
?>

주의

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

참고



add a note add a note User Contributed Notes
mysql_field_len
adam_nospam_hunger at yahoo dot com
31-Oct-2003 01:04
For a mysql type DECIMAL(8,4), the length is returned as 10 (M+2 as per documentation).

mysql_field_name> <mysql_field_flags
Last updated: Fri, 24 Jul 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites