Hi ich möchte meine Shopdaten aus meiner SQL exportieren so das für jeden Artikel ne eigene HTML-Datei erstellt wird :-)
Hatte mir folgendes überlegt :
leider bekomme ich immer diese Fehlermeldung . "
Fatal error: Call to a member function on a non-object in /home/www/web0/html/r04_de/Neu2.php on line 19
"
weis jemand rat ? fand meine Idee garnicht so schlecht *smile* . Danke schonmal im Vorraus
Hatte mir folgendes überlegt :
PHP-Code:
<?php
$mysqlhost="localhost"; // MySQL-Host angeben
$mysqluser=vvvvv"; // MySQL-User angeben
$mysqlpwd="vvvvv"; // Passwort angeben
$mysqldb="vvvvvv"; // Gewuenschte Datenbank angeben
$connection=mysql_connect($mysqlhost, $mysqluser, $mysqlpwd) or die("Verbindungsversuch fehlgeschlagen");
mysql_select_db($mysqldb, $connection) or die("Konnte die Datenbank nicht waehlen.");
$art_count = 1;
$artdaten = array();
$sql = "SELECT Title,Description_short,DisplayPrice,Img_url,DeepLink1,ProductCategoryID,ProductCategoryName
FROM burda_ ";
$artresult = $connection->select($sql);
if($connection->rows > 0) {
while($daten = mysql_fetch_array($artresult)) {
$artdaten[$art_count]['beschreibung'] = $daten['Description_short'];
$artdaten[$art_count]['preis'] = $daten['DisplayPrice'];
$artdaten[$art_count]['bild_url'] = $daten['Img_url'];
$artdaten[$art_count]['partnerlink'] = $daten['DeepLink1'];
$artdaten[$art_count]['produktid'] = $daten['ProductCategoryID'];
$artdaten[$art_count]['produktidname'] = $daten['ProductCategoryName'];
//start the file name
$filename = $artdaten[$art_count]['beschreibung'].'test.html';
//open html file for writing
$handle = fopen($filename,'w+');
//write header to html file
fwrite($handle, $artdaten[$art_count]['beschreibung']);
}
}
?>
Fatal error: Call to a member function on a non-object in /home/www/web0/html/r04_de/Neu2.php on line 19
"
weis jemand rat ? fand meine Idee garnicht so schlecht *smile* . Danke schonmal im Vorraus
Kommentar