Così dovrebbe andare:
Codice PHP:
$res mysql_query("SHOW COLUMNS from tabella");
$i 1;
while (
$row mysql_fetch_array($res)) {
   
$nome_foglio->write_string(1$i$row[0], $formatot);
/*
  $nome_foglio->write_string(1,2,"Numero Pratica",$formatot);
*/
   
$i++;

Però, come dice filippo.toso, devi studiare un po' di più come si usano gli array in PHP.