you'll have to create your query with php
with something like this :
i don't know how you can know how many columns you need,
the key is to loop while there are columns
$sql="UPDATE table SET ";
$i=1;
while(there are columns)
$sql.=" col".$i."='".${"col".$i++}."',";
}
if($i>1) {
$sql=substr($sql,0,-1); //remove the last ',' which would give an error
$sql.="WHERE id='$id'";
mysql_query($sql,$connection);
} else {
echo "no columns to update";
}