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

Storing XML in MySQL with SimpleXML:problem?

I have an XML which stores the contents of a page, further the XML is to be stored in the database. The content can be html, text with special characters,etc.
I have a form to take the value from the user. If the user gives some special characters to in the txtmatter, I want to encode them, and at the time of fetching I want to decode them.

I have successfully encoded the value of special characters of <txtmatter> with the use of htmlspecialchars() but it is not storing in the xml in encoded form.

Also, can I use the XPATH query of MYSQL to update the XML?.


XML Generated:
<?xml version="1.0"?>
<contents>
<page_title>Page</page_title>
<section_heading>Section Heading</section_heading>
<heading>Heading</heading>
<subheading>Sub Heading</subheading>
<txtmatter>blah blah blah " " " " " " ` ` ` `' ' ' 'blah blah '</txtmatter>
</contents>
And want like this to store in the database.
<?xml version="1.0"?>
<contents>
<page_title>Page</page_title>
<section_heading>Section Heading</section_heading>
<heading>Heading</heading>
<subheading>Sub Heading</subheading>
<txtmatter>blah blah blah &quot; &quot; &quot; &quot; &quot; &quot; ` ` ` `' ' ' 'blah blah </txtmatter>
</contents>



Best Regards

Prashant
Mar 30 '07 #1
0 1490

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

Similar topics

1
by: David | last post by:
Hi, I am running Debian 3.0r1 with Apache 1.3.27, MySQL 3.23.49 and PHP 4.3.3RC3. I installed Apache and MySQL when I originally installed Debian and these work fine. I recently wanted to run...
4
by: Google Mike | last post by:
I have RH9 and am using the PHP and MySQL that came with it. I was doing fine with all manner of my web pages for this app until I started having this very strange problem. It's a work order...
6
by: pc_newbie | last post by:
Hi, i got a problem with php->mysql Fatal error: Call to undefined function: mysql_pconnect() in /var/www/update.php on line 4 both php and mysql are installed into debian, but don't know how...
2
by: Martin | last post by:
I can't find a newsgroup dedicated to MySQL - is it appropriate to post a question about it here? Most anything I try to do (explain table, drop table, drop database) results in "Error 2013 -...
0
by: dohnut | last post by:
Here's one for some bored problem solver :) I ran across this earlier today and fixed it, but don't exactly know why. (that usually only happens in C :) I'm using Perl version 5.8.0 btw. ...
0
by: PowerLifter1450 | last post by:
Hi everyone, hoepfully someone can help me with this problem, as I am new to Linux and not so sure how to troubleshoot this problem. I installed MySQL 4.1.21 on Fedora Core two without receiving...
0
by: nrip | last post by:
Dear All, I am facing a very peculiar problem. I am reading a CSV file from my JSP code and trying to insert them into MYSQL database. the program first reads a line and then splits it into words...
4
by: Frank Lopes | last post by:
I've seen many people asking the same question in other forums but I haven't been able to solve this problem. First the environment: Windows Vista Ultimate running IIS6 Now the story:...
30
by: Einstein30000 | last post by:
Hi, in one of my php-scripts is the following query (with an already open db-connection): $q = "INSERT INTO main (name, img, descr, from, size, format, cat, host, link, date) VALUES ('$name',...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.