분류
php
mysql_fetch_field()함수
본문
코드 :
mysql_connect("db_host","db_user","db_pass");
mysql_select_db("db_name");
$query = "SELECT * FROM mytable LIMIT 1";
$result = mysql_query($query);
$fields = mysql_num_fields($result);
for($count=0;$count<$fields;$count++)
{
$field = mysql_fetch_field($result,$count);
echo "$field->name $field->type ($field->max_length)";
}
- 이전글mysql_fetch_row()함수 18.01.16
- 다음글mysql 테이블에 데이터 삽입 18.01.15