Interesante recopilación de funciones PHP para interactuar con MySQL. Un ejemplo:
function getCommaFields( $table, $excepts = ""){
// get a string with the names of the fields of the $table,
// except the onews listed in '$excepts' param
$out = "";
$result = mysql_query( "SHOW COLUMNS FROM `$table`" );
while($row = mysql_fetch_array($result)) if ( !stristr(",".$row['Field']."," , $excepts) ) $out.= ($out?",":"").$row['Field'];
return $out ;
}
La función obtiene una cadena con los nombres de campos de la tabla especificada, excepto los campos mencionados en la variable $excepts.




