J
jxgxy
Unregistered / Unconfirmed
GUEST, unregistred user!
function tbl2xml($table, $entry, $fname) {
//header("Content-type: text/xml"
// selectAllFrom === SELECT * FROM ...
$this->selectAllFrom($table);
$fcount = mysql_num_fields($this->res);
$str = "<?xml version=/"1.0/" ?>";
$str .= "<$table>";
while($row = mysql_fetch_array($this->res)) {
$str .= "<$entry>";
for($i=0; $i< $fcount; $i++) {
$tag = mysql_field_name( $this->res, $i );
$str .= "<$tag>". $row[$i]. "</$tag>";
}
$str .= "</$entry>";
}
$str .= "</$table>";
if (isset($fname)) {
$fh = fopen($fname, "w"
fputs($fh, utf8_encode($str));
}
return $str;
}
//header("Content-type: text/xml"
// selectAllFrom === SELECT * FROM ...
$this->selectAllFrom($table);
$fcount = mysql_num_fields($this->res);
$str = "<?xml version=/"1.0/" ?>";
$str .= "<$table>";
while($row = mysql_fetch_array($this->res)) {
$str .= "<$entry>";
for($i=0; $i< $fcount; $i++) {
$tag = mysql_field_name( $this->res, $i );
$str .= "<$tag>". $row[$i]. "</$tag>";
}
$str .= "</$entry>";
}
$str .= "</$table>";
if (isset($fname)) {
$fh = fopen($fname, "w"
fputs($fh, utf8_encode($str));
}
return $str;
}