note 90699 deleted from function.mysql-list-fields by danbrown
| From: | danbrown@php.net | Date: | Tue, 05 May 2009 13:35:46 +0000 |
| Subject: | note 90699 deleted from function.mysql-list-fields by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154227@lists.php.net to get a copy of this message | ||
Note Submitter: disymewn2 at yahoo dot gr
----
This is how to get all column names in one array...
WORKS PERFECT !!!!
$result = mysql_query ("SHOW COLUMNS FROM
my_table ");
$i=0;
while ( $row = mysql_fetch_array($result) )
{
$col_names[$i] = $row[0];
echo '--'.$col_names[$i].'--</br>';
$i++;
}// while