분류 php

mysql_fetch_field()함수

컨텐츠 정보

  • 조회 507 (작성일 )

본문

코드 : 

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



php