Hi all
need to write php code to get xml dynamic page. i have attached an out of the code can any one help to solve it out?
i have created database name called 'new' with 3 tables first is 'games' with field gid as primary key, gname primary key gid, second table is 'levels' with the field lvalue as primary key , gid as foreign key and the third table is display_items with did as primary key , dname meaning , position , shape , lid as foreign key.
please see the attachment file and help me to create PHP code to get this output.
Thanks
3 1858
This is not a code writing service but if you post the code you've tried along with a description of the problem you're having with it, we can help guide you to a solution.
Also, as a rule of thumb, we don't download attachments from strangers. Please post all pertinent information in the thread itself. If it is code or XML, use code tags when doing so.
The following is php code - <?php
-
-
$xml = new SimpleXMLElement('<xml/>');
-
-
$conn=mysql_connect('localhost','root','password') or die(mysql_error());
-
-
mysql_query("SET NAMES 'utf8'", $conn);
-
mysql_select_db('new') or die (mysql_error());
-
-
-
$games = $xml->addChild('games');
-
$game = $games->addChild('game');
-
-
$query1 = mysql_query("SELECT game_id , game_name FROM games");
-
$query2 =mysql_query("SELECT * FROM levels WHERE game_id = " . $row['game_id'] .");
-
$query3 =mysql_query("SELECT * FROM Letter_info WHERE level_value = " . $sql2['level_value'] .");
-
-
if($query_run1 = mysql_query($query1)){
-
if ($query_run2 = mysql_query($query2)){
-
if ($query_run3 = mysql_query($query3)){
-
$query_row1 = mysql_fetch_assoc($query_run1);
-
$game_id = $game->addChild('gameid', "$query_row1[game_id]");
-
$game_name = $game->addChild('gamename' , "$query_row1[game_name]");
-
$levels = $game->addChild('levels');
-
$query_row2 = mysql_fetch_assoc($query_run2);
-
-
-
-
$level = $levels->addChild('level');
-
$level_value = $level->addChild('levelvalue'."$query_row2[level_value]");
-
-
-
while($query_row3 = mysql_fetch_assoc($query_run3)){
-
-
-
-
$displayitem = $level->addChild('displayitems');
-
$letter_id = $displayitem->addChild('displayid' , "$query_row3[letter_id]");
-
$letter_name = $displayitem->addChild('display_name' , "$query_row3[letter_name]");
-
$meaning = $displayitem->addChild('Meaning' , "$query_row3[meaning]");
-
$position = $displayitem->addChild('Position' , "$query_row3[position]");
-
$shapes = $displayitem->addChild('shapes');
-
$shape = $shapes->addChild('shape', "$query_row3[shape1]");
-
}
-
-
-
-
}
-
}
-
}
-
-
Header('Content-type: text/xml');
-
-
print($xml->asXML());
-
?>
NEED TO GET XML DYNAMIC PAGE AS OUT PUT:
HELP ME SOLVE THIS WHERE I GET THE PROBLEM
You haven't said what the problem is. Are you getting error codes? What are they? Are you getting incorrect output? What is the incorrect output?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mark |
last post by:
I'm interested in displaying a dynamic page title, rather than the static
html <title>My Page</title>. In a previous posting, I had seen a suggestion
of making the title into a server control...
|
by: Jignesh Desai |
last post by:
There are essentially two ways that you can write code for an ASP.NET
application.
Inline code Style
---------------------------------------------------------------
<html>
<script...
|
by: vodafone |
last post by:
Hy all
I've a little problem. I need to write a dynamic page that render
control according to validation status return from previous control
validation status.
To be clear, I've page that...
|
by: Learner |
last post by:
Hello,
We use Master Pages in our website and need a page to be created
dynamically. I am not sure where I am missing but I don't see any error
and the controls on the page either!
Here is my...
|
by: Chris |
last post by:
Can anyone recommend how to do a screen scrape from a dynamic page and save
it to a text file? Regards, Chris.
|
by: Ed Jay |
last post by:
I generate a DHTML page (a medical report) with dynamically generated text
based on user input (answers to questions). The page length changes
dynamically. I desire that when the page is printed...
|
by: florencepushpa |
last post by:
hi,
i need to create a staic and dynamic page in html.pls give the code.
Thank u
Pushpa
|
by: ycquak |
last post by:
Hi,
Currently I need to read contents from a dynamic page, which goes
something like:
http://servername/filename.jsp?arg1=a&arg2=b
The content is not static, neither is there a file for me to...
|
by: braich |
last post by:
Hi All
I am new to PHP and have been reading few basic books on PHP. I am trying to create a dynamic page based on the keyword in the url.
Let’s say I have...
|
by: ganesh22 |
last post by:
Hi,
How to write code in page load to display that window size like popup?
ex:
Here i writen the code in OnClientClick event now i want in page load
javascript:window.open('Default4.aspx?a='...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |