Re: Database => XML

From: Date: Tue, 03 Oct 2000 14:02:48 +0000
Subject: Re: Database => XML
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-34155@lists.php.net to get a copy of this message
Hello Martin, Will you please stop crossposting the same thing twice to this list? If you need help, just write to php-general@lists.php.net. (or php-db) The php-dev list is only for developers. Alternatively, you can ask question on IRC, #php on EFNet. Derick Rethanc Martin Bouman wrote: > > Dear Sir / Madam, > > > > I am a student working at TeleCats BV in the Netherlands. > > The project I am working on right now has to do with XML. > > The company wants me to read records from an MS Access database > > and put htese in a XML file (just like with HTML (I use Apache Cocoon XML > > Server)), which > > will be translated to HTML, WML or VXML bymeans of XSL. > > > > The problem is the first part. To read the records and put them in a XML > > file. > > Below is an example of how our XML-file looks: > > > > <?xml version="1.0"?> > > <?xml-stylesheet href="rooster.xsl" type="text/xsl"?> > > <?cocoon-process type="xslt"?> > > > > <?php > > Include("db.php"); > > $dbcart = new db; > > $dbcart->init("odbc"); > > $dbcart->open("rooster","localhost","",""); > > $query="SELECT * > > FROM Rooster; > > $dbcart->query($query); > > ?> > > > > <programma> > > <?php > > while($dbcart->getrow()) { > > $ps = $dbcart->field(1); > > $datum = $dbcart->field(2); > > $sport1 = $dbcart->field(3); > > $sport2 = $dbcart->field(4); > > ?> > > <dag> > > <ps><?php echo $ps; ?></ps> > > <datum><?php echo $datum; ?></datum> > > <sport1><?php echo $sport1; ?></sport1> > > <sport2><?php echo $sport2; ?></sport2> > > </dag> > > <?php > > } > > $dbcart->close(); > > ?> > > </programma> > > > > The first line indicates that it is an XML-file. > > The second line associates the stylesheet with it. > > The third line indicates that Cocoon should handle the XML-file. > > 'db.php' makes the connection to the database 'rooster'. > > When we request the XML-page in a webbrowser the HTML-code > > (generated by the XSL-file) is presented to me, but without the values > > ($datum, $sport1, etc.). > > Is there a solution to this problem? Can PHP 4.02 read records from a > > database from within a XML-file and > > translate them by means of XSL? > > > > I hope you can help me with this problem and am looking forward to your > > reaction! > > Yours Sincerely, > > Martin Bouman, TeleCats BV (Netherlands) > > P.s: I have enclosed all the files described above. > > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Derick Rethans JDI Media Solutions H.v.Tussenbroekstraat 1 6952 BL Dieren The Netherlands e-mail: d.rethans@jdimedia.nl http://www.jdimedia.nl/

« previous php.dev (#34155) next »