Hi All,
Im wanting the following script to output to an XML file, but im getting an error on line 18 and i have hit a brick wall.
Help would be appreciated.
<?php
require_once("connect.inc.php");
$db = getConnectionMySql();
$stmt = $db->query("SELECT email, name, lastlogin FROM subscriber");
while ( $obj = $stmt->fetchObject()){
echo $obj->email . ":" . $obj->name . ":" . $obj->lastlogin . "<br />";
// print " <row>\n";
// print " <email>$email</email>\n";
//print " <name>$name</name>\n";
//print " <lastlogin>$lastlogin</lastlogin>\n";
//print " </row>\n";
}
$fp = fopen('subscribers.xml','w');
if(!$fp) {
die('Error cannot create XML file');
}
fwrite($fp->$obj());
fclose($fp);
?>