Forum Moderators: coopster

Message Too Old, No Replies

XML feed from Mysql database with PHP

         

kekko

12:01 pm on Dec 22, 2006 (gmt 0)

10+ Year Member



Hi Folks,
i'm finding myself with the task of writing a php script to automatically compile an XML feed with some standard tags and some tags with data taken from a MySql database.

I wonder if somebody has found a script somewhere that does just that.
Many Thanks and a Happy New Year,
Kekko

Stuperfied

12:30 pm on Dec 22, 2006 (gmt 0)

10+ Year Member



Dont know of any, probably could write one but too tired and not enough time at the moment. My advice for if you do get it going would be not to make it too deep or your end users will have fun trying to put it into arrays. Also try not to use attributes, just name and data because attributes are a nightmare to handle from a coding point of view. Sure, their easy to get the information out of but who knows where to put it.

eg:


$foo = array();

for ($a=0; $a<sizeof($stack); $a++) {
for ($b=0; $b<sizeof($stack); $b++) {
for ($c=0; $c<sizeof($stack); $c++) {
for ($d=0; $d<sizeof($stack); $d++) {
for ($e=0; $e<sizeof($stack); $e++) {
for ($f=0; $f<sizeof($stack); $f++) {
for ($g=0; $g<sizeof($stack); $g++) {
for ($h=0; $h<sizeof($stack); $h++) {
for ($i=0; $i<sizeof($stack); $i++) {
for ($j=0; $j<sizeof($stack); $j++) {

$name = $stack[0][children][$a][children][$b][children][$c][children][$d][children][$e][children][$f][children][$g][children][$h][children][$i][children][$j][$name]; // 0_o

$data = $stack[0][children][$j][children][$b][children][$c][children][$d][children][$e][children][$f][children][$g][children][$h][children][$i][children][$a][$cdata]; //!@#$%&

$foo = array($name => $data); $attrs? //.. huh?

}
}
}
}
}
}
}
}
}
}

[edited by: Stuperfied at 12:42 pm (utc) on Dec. 22, 2006]