•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,993 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,798 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 362 | Replies: 3
![]() |
Hello I need to do a form that writes to a database I know how to do that What I dont now how to do is how I dump my data from the db as XML
I want the data to come out like this on the xml
<jobs>
<job id="5575757" title="Teacher" company="Mesa Public Schools" location="Mesa, AZ" />
<job id="8585858" title="Teacher" company="Tempe Public Schools" location="New York, NY" />
</jobs>
Any Ideas Thank you
I want the data to come out like this on the xml
<jobs>
<job id="5575757" title="Teacher" company="Mesa Public Schools" location="Mesa, AZ" />
<job id="8585858" title="Teacher" company="Tempe Public Schools" location="New York, NY" />
</jobs>
Any Ideas Thank you
Use concatenate . and escaping \ operators like:
In this way we have the result in xml syntax.
echo "<job id=\"". $result['id'] ."\" title=\"". $result['title'] ."\" company=\"". $result['company'] ."\" location=\"". $result['location'] ."\" />";
In this way we have the result in xml syntax.
•
•
•
•
Use concatenate . and escaping \ operators like:
echo "<job id=\"". $result['id'] ."\" title=\"". $result['title'] ."\" company=\"". $result['company'] ."\" location=\"". $result['location'] ."\" />";
In this way we have the result in xml syntax.
Ok but I will create a table call jobs right and the fields will be
Job_id
Title
Company
Location
Am I right?
Thank you
Yes, more difficult is to put xml data to db. Depending on your PHP version, if it is 5 you can use built-in SimpleXML functions, or in case if it is PHP4 you will need a class to parse xml to an array. Both cases will provide to you access to element attributes in a variable to put afterwards in db.
Last edited by martin5211 : Dec 5th, 2007 at 2:34 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- C command-line I/O question (C++)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- Question (Geeks' Lounge)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science and Software Design)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the PHP Forum
- Previous Thread: Passing variables to a different server
- Next Thread: adding php scrips ?????


Linear Mode