note 40259 deleted from function.mysql-num-fields by irchtml

From: Date: Thu, 26 Feb 2004 19:53:35 +0000
Subject: note 40259 deleted from function.mysql-num-fields by irchtml
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-65828@lists.php.net to get a copy of this message
Note Submitter: mattwheaton@hotmail.com ---- this function returns an array with the list of field names in a specific table: <?php function getFieldNames($table, $link){ $rslt = mysql_query("SELECT * FROM $table", $link); $fields = array(); for ($i = 0; $i < mysql_num_fields($rslt); $i++){ array_push($fields, mysql_field_name($rslt, $i)); } return $fields; } ?>

« previous php.notes (#65828) next »