473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

XML file in PHP

78
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <config>
  3.  
  4.     <param name="mp3" value="Aise Na Mujhe.mp3|musicfiles/49_All_Praise_to_You__Eternal_Lord.mp3|musicfiles/49_Christians_Awake.mp3|musicfiles/49_Comfort_and_Joy.mp3|musicfiles/49_Down_from_His_Glory.mp3|musicfiles/49_Jesus__You_re_Worth_Everything.mp3|musicfiles/49_Jesus_Christ_is_Risen_Today.mp3|musicfiles/49_Mother_s_Christmas_Night.mp3|musicfiles/49_Rebuilding.mp3|musicfiles/49_Saw_You_Never.mp3|musicfiles/49_The_Love_of_God_is_Greater_Far.mp3" />
  5.  
  6.  
  7.  
  8.  
  9.     <param name="title" value="Aise Na Mujhe.mp3" />
  10.     <param name="height" value="150" />
  11.     <param name="width" value="225" />    
  12.     <param name="bgcolor1" value="fbdb03" />
  13.     <param name="bgcolor2" value="fbdb03" />
  14.     <param name="buttoncolor" value="090909" />
  15.     <param name="buttonovercolor" value="0aaf01" />
  16.     <param name="slidercolor1" value="babababa" />
  17.     <param name="slidercolor2" value="cccccc" />
  18.     <param name="sliderovercolor" value="10a905" />
  19.     <param name="textcolor" value="000000" />
  20.     <param name="playlistcolor" value="813d07" />
  21.     <param name="currentmp3color" value="ffffff" />
  22.     <param name="scrollbarcolor" value="000000" />
  23.     <param name="scrollbarovercolor" value="288404" />
  24.     <param name="showvolume" value="1" />
  25.     <param name="showinfo" value="1" />
  26.  
  27.  
  28. </config>
  29.  
This is my XML file. and I am using swf player to play the songs.
My problem is I want to fetch the data(mp3 file in my musicfile folder and path in my database) from phpmyadmin database to this xml file. Is it possible?

please help me friends..........

--Ammu
Mar 16 '12 #1
3 1380
dlite922
1,584 Expert 1GB
Yes it's possible. You need to connect to your database using combination of the following functions: mysql_connect() mysql_select_db(), mysql_query() and mysql_fetch_<type>();

Checkout the PHP manual at php.net if you don't know how to use any of these functions.

Good luck,


Dan
Mar 16 '12 #2
Ammu
78
Thank you for your response......

yes i know these functions to fetch the data from database. But my probelm is i want to write these codes in xml file. my file is songs.xml
Expand|Select|Wrap|Line Numbers
  1. $conn=mysql_connect("localhost","root","")or die("Unable to connect");
  2. $select=mysql_select_db("sample",$conn) or die("Unable to connect");
  3.  
i tried to write this php connection code in xml file but not working shows error

--Ammu
Mar 17 '12 #3
Luuk
1,047 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $string = <<<XML
  4. <?xml version="1.0" encoding="UTF-8"?>
  5.   <config>
  6.   </config>
  7. </xml>
  8. XML;
  9.  
  10. $xml = new SimpleXMLElement(<<<EOXML
  11. <?xml version="1.0" encoding="UTF-8"?>
  12. <config>
  13. </config>
  14. EOXML
  15. );
  16.  
  17. $item = $xml->addChild('param', '');
  18. $item->addAttribute('name', 'mp3');
  19. $item->addAttribute('value', 'something');
  20.  
  21. $item = $xml->addChild('param', '');
  22. $item->addAttribute('name', 'height');
  23. $item->addAttribute('value', '150');
  24.  
  25. echo $xml->asXML();
  26.  
  27. ?>
  28.  
Mar 29 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
0
by: chris | last post by:
I'm writing a small app to help me learn more about cryptography. All it does is encrypt all of the files in directory A, and put the encrypted versions of the files in directory B. It then...
5
by: simon place | last post by:
is the code below meant to produce rubbish?, i had expected an exception. f=file('readme.txt','w') f.write(' ') f.read() ( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) on win32. ) I got...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
1
by: Mika M | last post by:
I have made Setup and Deployment Project for my application. This application uses couble of Crysral Report .rpt -files, so I included following into Setup and Deployment Project ... -...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.