Hi....
Hier ein script
<?PHP
/*************************************************************************************************************
* MySQL2Excel
* version: v0.0.1 (NOT TO BE CONTINUED...)
* author: e-voc [Uwe Pries]
* mailto:
[email protected]
* date: 2000-12-31
*************************************************************************************************************
* version: v0.0.2
* mailto:
[email protected]
* date: 2001-03-31
*************************************************************************************************************
* version: v0.0.3
* mailto:
[email protected]
* date: 2001-06-25
*************************************************************************************************************/
if($host && $user && $password && $database && $table) {
$query_text = "SELECT * FROM " . $table;
Header("Content-Type: application/vnd.ms-excel");
$db_link = mysql_connect($host, $user, $password);
mysql_select_db($database, $db_link);
$result = mysql_query($query_text, $db_link);
$fieldcounts = mysql_num_fields($result);
for($i = 0; $i < $fieldcounts; $i++) {
$fieldtype = mysql_fetch_field($result, $i);
if ($i < ($fieldcounts-1)) echo "$fieldtype->name [$fieldtype->type] ";
else echo "$fieldtype->name [$fieldtype->type]
";
}
$myrow = mysql_fetch_array($result);
do {
for($i = 0; $i < $fieldcounts; $i++) {
$fieldname = mysql_field_name($result, $i);
if ($i < ($fieldcounts-1)) echo $myrow[$fieldname] . " ";
else echo $myrow[$fieldname] . "
";
}
} while ($myrow = mysql_fetch_array($result));
} else {
?>
<form action="mysql2excel.php" method="post" target="_blank">
<table>
<tr>
<td>DB Host</td>
<td><input type="text" name="host" value="<?php echo $host; ?>"></td>
</tr>
<tr>
<td>Benutzer</td>
<td><input type="text" name="user" value="<?php echo $user; ?>"></td>
</tr>
<tr>
<td>Passwort</td>
<td><input type="password" name="password" value="<?php echo $password; ?>"></td>
</tr>
<tr>
<td>Datenbank</td>
<td><input type="text" name="database" value="<?php echo $database; ?>"></td>
</tr>
<tr>
<td>Tabelle</td>
<td><input type="text" name="table" value="<?php echo $table; ?>"></td>
</tr>
</table>
<br>
<input type="submit" name="submit" value="Daten nach MS Excel laden">
</form>
<?php
}
?>
cu
Dosul