MySQLi 환경에서 특정 테이블 모든 필드명 구하기
<?php function get_field_names($table, $link) { $columns = array(); $sql = ” select * from `$table` limit 1 “; $result = mysqli_query($link, $sql); while($field = mysqli_fetch_field($result)) { $columns[] = $field->name; } return $columns; } $link = mysqli_connect($host, $user, $pass, $db); if(!$link) { die(‘Connect Error (‘ . mysqli_connect_errno() . ‘) ‘ . mysqli_connect_error()); } $row = get_field_names(‘member’, …