note 58449 deleted from function.mysql-fetch-field by danbrown

From: Date: Sat, 20 Jun 2009 02:14:58 +0000
Subject: note 58449 deleted from function.mysql-fetch-field by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-157157@lists.php.net to get a copy of this message
Note Submitter: inaxio ---- just another option to get all enum|set values from table definition. values are stored into arrays using the same field name $result = mysql_query("SHOW COLUMNS FROM [table_name]"); while($row = mysql_fetch_object($result)){ if(ereg(('set|enum'), $row->Type)){ eval(ereg_replace('set|enum', '$'.$row->Field.' = array', $row->Type).';'); } }

« previous php.notes (#157157) next »