se guarid qua http://php.net/manual/en/mysqli-result.fetch-field.php trovi la risposta. Esempio:

Codice PHP:
$mysqli = new mysqli("localhost""my_user""my_password""world");

$query "SELECT ID_Prodotto AS Id FROM prodotti ORDER BY Nome";

if (
$result $mysqli->query($query)) {

    while (
$finfo $result->fetch_field())
        
$_SESSION[$finfo->name] = 'xxxx';

    
$result->close();
}

$mysqli->close();