473,395 Members | 1,466 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,395 software developers and data experts.

how to put mysql connection and php code within xml file

25
Hello everyone,
I'm new in xml. I have faces some problem
that is i dont know how to connect mysql and put php code in xml file.

Below is the code about 10 images (slideshow) which are static. I would like to make it dynamic which is the images called from database and uses while looping there.

Please help me to solve this matter.

p/s:or u all can download the file and change from there.. thanks u all.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.  
  4. <artworkinfo>
  5.  
  6.     <albuminfo>
  7.         <artLocation>http://bytes.com/images/album1.jpg</artLocation>
  8.         <artist>The Doors</artist>
  9.         <albumName>Greatest Hits</albumName>
  10.         <artistLink>http://www.google.com</artistLink>
  11.         <albumLink>http://www.yahoo.com</albumLink>
  12.     </albuminfo>
  13.  
  14.     <albuminfo>
  15.         <artLocation>http://bytes.com/images/album2.jpg</artLocation>
  16.         <artist>The White Stripes</artist>
  17.         <albumName>Elephant</albumName>
  18.         <artistLink>http://www.weberdesignlabs.com</artistLink>
  19.         <albumLink>http://www.freelanceswitch.com</albumLink>
  20.     </albuminfo>
  21.  
  22.     <albuminfo>
  23.         <artLocation>http://bytes.com/images/album3.jpg</artLocation>
  24.         <artist>Kanye Wests</artist>
  25.         <albumName>Graduation</albumName>
  26.         <artistLink>http://www.kanyewest.com</artistLink>
  27.         <albumLink></albumLink>
  28.     </albuminfo>
  29.  
  30.     <albuminfo>
  31.         <artLocation>http://bytes.com/images/album4.jpg</artLocation>
  32.         <artist>A Fine Frenzy</artist>
  33.         <albumName>One Cell In The Sea</albumName>
  34.         <artistLink>http://www.google.com</artistLink>
  35.         <albumLink>http://www.yahoo.com</albumLink>
  36.     </albuminfo>
  37.  
  38.     <albuminfo>
  39.         <artLocation>http://bytes.com/images/album5.jpg</artLocation>
  40.         <artist>Amy Winehouse</artist>
  41.         <albumName>Back to Black</albumName>
  42.         <artistLink>http://www.google.com</artistLink>
  43.         <albumLink>http://www.yahoo.com</albumLink>
  44.     </albuminfo>
  45.  
  46.     <albuminfo>
  47.         <artLocation>http://bytes.com/images/album6.jpg</artLocation>
  48.         <artist>The Vines</artist>
  49.         <albumName>Highly Evolved</albumName>
  50.         <artistLink>http://www.google.com</artistLink>
  51.         <albumLink>http://www.yahoo.com</albumLink>
  52.     </albuminfo>
  53.  
  54.     <albuminfo>
  55.         <artLocation>http://bytes.com/images/album7.jpg</artLocation>
  56.         <artist>The Strokes</artist>
  57.         <albumName>Is This It</albumName>
  58.         <artistLink>http://www.google.com</artistLink>
  59.         <albumLink>http://www.yahoo.com</albumLink>
  60.     </albuminfo>
  61.  
  62.     <albuminfo>
  63.         <artLocation>http://bytes.com/images/album8.jpg</artLocation>
  64.         <artist>Yeah Yeah Yeahs</artist>
  65.         <albumName>Maps - Single</albumName>
  66.         <artistLink>http://www.google.com</artistLink>
  67.         <albumLink>http://www.yahoo.com</albumLink>
  68.     </albuminfo>
  69.  
  70.     <albuminfo>
  71.         <artLocation>http://bytes.com/images/album9.jpg</artLocation>
  72.         <artist>DangerDoom</artist>
  73.         <albumName>The Mouse and the Mask</albumName>
  74.         <artistLink>http://www.google.com</artistLink>
  75.         <albumLink>http://www.yahoo.com</albumLink>
  76.     </albuminfo>
  77.  
  78.     <albuminfo>
  79.         <artLocation>http://bytes.com/images/album10.jpg</artLocation>
  80.         <artist>Fort Minor</artist>
  81.         <albumName>The Rising Tied</albumName>
  82.         <artistLink>http://www.google.com</artistLink>
  83.         <albumLink>http://www.yahoo.com</albumLink>
  84.     </albuminfo>
  85.  
  86.  
  87. </artworkinfo>
Attached Files
File Type: zip help_me.zip (855.7 KB, 99 views)
Nov 10 '10 #1
4 2137
Dormilich
8,658 Expert Mod 8TB
i dont know how to connect mysql and put php code in xml file.
you do that by putting it all in a .php file (don’t forget to declare the output as XML). you may achieve the same by an XSL transformation, though that’s a rather complicated way to go.
Nov 10 '10 #2
amel86
25
sorry.. im still not clear
Nov 12 '10 #3
Dormilich
8,658 Expert Mod 8TB
to put it simple, you don’t put PHP instructions in an XML file, you put XML data in a PHP file.
Nov 12 '10 #4
jkmyoung
2,057 Expert 2GB
You would almost never pass PHP code through the XML, for security among other reason. Do you want to be able to read the XML using PHP? Are you viewing this 'slideshow' in an internet browser?
Nov 12 '10 #5

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

Similar topics

1
by: Luke Wojtow | last post by:
Hi all, http://bugs.mysql.com/bug.php?id=3779 Discussion about insecurity of mysql_pconnect in multi-server/multi-user environment.Can anyone explain what Hartmut Holzgraefe meant by "But even...
0
by: Gregory | last post by:
I am using OS X and Dreamweaver MX. I am trying to make a connection to the MySQL Server from within Dreamweaver using the Applications panel and clicking on the "+". A window opens asking for:...
2
by: francescomoi | last post by:
Hi. I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ---------------------------------- # export PATH=$PATH:/usr/local/mysql/bin/ # export mysqlclient=mysqlclient_r # python setup.py...
0
by: Peter Höltschi | last post by:
I try to install MySQL Connection/J on a Windows XP box. MySQL on localhost works fine. But I cannot load the MySQL Connection/J Driver. The CLASSPATH variable is set like this:...
3
by: arrow | last post by:
Hi everybody; I am trying to connect to MySQL server over MySQL ODBC 3.51 driver. Borland C++ 5.02 is the tool I use. I tried a simple connection code below: #include <stdio.h> #include...
5
by: ernie.bornheimer | last post by:
Hello I have a script that works but it shouldn't, and I would like to know why. I originally wrote it with a statement to connect to the database, then there's a part to select the database,...
4
by: obmij | last post by:
Hi all, I am a WAMP newbie and would appreciate your help! I have installed Apache 2.2.4, Mysql 5 and PHP 5 have got them all up and running and tested them separately, I was able to do the...
3
by: tulika dutta | last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
13
by: tommurray | last post by:
Hi all I am new to php and i need a little help, I have a webpage which is going to draw all the content from a database were the user can login and amend the values of the field. Within the...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.