hallytom Posted December 13, 2012 Share Posted December 13, 2012 Hi, Firstly as a disclaimer, I am not requesting any code to be supplied, this is to be used in a University project and I am aware of the relevant regulations and would like to create the code myself, I am only trying to get help pointing me in the right direction. I am using PHP to display the contents of a MySQL database, as part of the product I would like to display the database in a format similar to a directory browser. I am reading in from an XML file of the database which is created using MySQL dump, I would then like to be able to iterate through this and display the Databases and tables in a list almost, but one that is dynamic and possibly interactive to the point of being able to select tables and fields to be able to view in more detail in another part of the program. Is this possible to achieve using PHP or any other languages that can be incorporated into this program. As an example, below is how I would like to display the contents to the user, with the + and - representing the default standard or showing more or less sub content. +ROOT -MySQL -Schema -Table 1 -File 1 +Table 2 +User Table 1 Thanks in advance for any help. Regards, Tom Quote Link to comment https://forums.phpfreaks.com/topic/271957-displaying-xml-content/ Share on other sites More sharing options...
Christian F. Posted December 13, 2012 Share Posted December 13, 2012 Yes, this is quite possible. All you need is to read the XML file with the SimpleXML class, then loop through the schema's tables. Since the number of fields is variable as well, you'll need a secondary inner loop for them, but that's pretty much it. PS: This should probably have been posted in the "Application design" section, seeing as you're not actually looking for help with your PHP code. Quote Link to comment https://forums.phpfreaks.com/topic/271957-displaying-xml-content/#findComment-1399169 Share on other sites More sharing options...
hallytom Posted December 13, 2012 Author Share Posted December 13, 2012 Yes, this is quite possible. All you need is to read the XML file with the SimpleXML class, then loop through the schema's tables. Since the number of fields is variable as well, you'll need a secondary inner loop for them, but that's pretty much it. Thanks for the assistance, how about displaying the data would this just be down to formatting in html? Regards, Tom Quote Link to comment https://forums.phpfreaks.com/topic/271957-displaying-xml-content/#findComment-1399203 Share on other sites More sharing options...
Christian F. Posted December 13, 2012 Share Posted December 13, 2012 Yep, that'd be all HTML and CSS. PHP runs on the server side, and is used to generate HTML that's sent to the client (browser). It's highly recommended to put all of the processing PHP code at the top of the page, and complete it before sending any output (HTML) to the client. Quote Link to comment https://forums.phpfreaks.com/topic/271957-displaying-xml-content/#findComment-1399259 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.