在SHOW FIELDS FROM mysql表中没有结果

I'm working on a back office project - I first implemented add, update and delete database entries and now I need to imlement some specific actions on some datatypes. So I want to retrieve the datatype Only the $fieldtypes = mysql_query("SHOW FIELDS FROM mysqltable"); returns NULL

This is how code is at this time :

<?php
$serveur='localhost'; 
$user='root'; 
$password='xxxx'; 
$base='db'; 
$champs=array(
"member"=>array("id","group","login","lastname","firstname","email","pswd","account","searchingfor","searchingfordistance","searchedfor","searchedfordistance","mydescription","groupdescription","searchdescription","resourcesdescription"),
    "place"=>array("id","idm","ids","name","town","postalcode","address","coord")
);

$connexion = mysql_connect("$serveur","$user","$password") or die ("Impossible de se connecter à la base de données");
mysql_select_db("$base",$connexion) or die("Erreur de connexion a la base de donnees");

$fieldtypes = mysql_query("SHOW FIELDS FROM place");

ob_start(); 
var_export($fieldtypes); 
$tab_debug=ob_get_contents(); 
ob_end_clean(); 
$fichier=fopen('gs.log','w'); 
fwrite($fichier,$tab_debug); 
fclose($fichier); 

... (rest of code works)

Can anyone help me to find out what went wrong ?

Thanks!

Even with a metadata query like SHOW FIELDS, you still need to fetch rows from your result resource. It behaves like a regular query returning rows, so fetch them in a while loop like you always would.

$fields = array();
$fieldtypes = mysql_query("SHOW FIELDS FROM place");
if ($fieldtypes) {
  while ($row = mysql_fetch_assoc($fieldtypes)) {
    $fields[] = $row;
  }
}
ob_start(); 
// Dump your $fields array
var_export($fields); 
$tab_debug=ob_get_contents(); 
ob_end_clean(); 

By the way, it is unnecessary and redundant to surround variables in double quotes when they are not being interpolated inside a string:

// Don't quote these vars -- it's poor practice
$connexion = mysql_connect("$serveur","$user","$password")