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

modify chars in files

I've an XML file where I've "'" char. I want to modify in all file the
"&apos" by "'". it's there any way to do it before parsing the XML file ?

Bob
Jul 17 '05 #1
6 1262
Bob Bedford wrote:
I've an XML file where I've "'" char. I want to modify in all file
the "&apos" by "'". it's there any way to do it before parsing the XML
file ?


Why do you want to do that? The various XML parsing PHP extensions
will transparently handle that for you anyway ...

--
Hartmut Holzgraefe, Senior Support Engineer .
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification
Jul 17 '05 #2

"Hartmut Holzgraefe" <ha*****@mysql.com> a écrit dans le message de news:
cs**********@online.de...
Bob Bedford wrote:
I've an XML file where I've "&apos;" char. I want to modify in all file
the "&apos" by "'". it's there any way to do it before parsing the XML
file ?


Why do you want to do that? The various XML parsing PHP extensions
will transparently handle that for you anyway ...

--
Hartmut Holzgraefe, Senior Support Engineer .
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification

Probably I didn't get the right extension, but when trying to get
attributes, the parser separate my text in 3
text: xxxxx'yyy
output:
xxxxx
'
yyy

Anyway I want to save such string in a Mysql table, so I've to care about,
as the insert statement is like insert.....,'xxxxx'yyy',
I've removed the ' with ereg_replace, but I'd like to get such character in
Mysql table, but don't know how.

Bob
Jul 17 '05 #3
Bob Bedford wrote:
Probably I didn't get the right extension, but when trying to get
attributes, the parser separate my text in 3
text: xxxxx'yyy
output:
xxxxx
'
yyy
This is something you always have to be aware of:
The parser may split character data into several chunks
and it is your responsibility to join them together if
needed.
Anyway I want to save such string in a Mysql table, so I've to care
about, as the insert statement is like insert.....,'xxxxx'yyy',
I've removed the ' with ereg_replace, but I'd like to get such character
in Mysql table, but don't know how.


http://php.net/mysql_real_escape_string

--
Hartmut Holzgraefe, Senior Support Engineer .
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification
Jul 17 '05 #4
> http://php.net/mysql_real_escape_string

Thanks for your asnwer.
I've seen you are senior support Enginner for mysql, you probably may help
for a question that wasn't answered. (very short)

I've a page where I get the result of a query. Each result points to a page
where there is the detail of the record. I'd like to add "previous" and
"next"buttons. The only way I've found is to put the results in an array,
then on any page, the array will tell me the next and previous record. It's
there a better way using mysql ?

Bob
Jul 17 '05 #5
On 2005-01-19, Bob Bedford <be******@YouKnowWhatToDoHerehotmail.com> wrote:
I've a page where I get the result of a query. Each result points to a
page where there is the detail of the record. I'd like to add
"previous" and "next"buttons. The only way I've found is to put the
results in an array, then on any page, the array will tell me the next
and previous record. It's there a better way using mysql ?


Offsets:

SELECT [...] FROM [table] LIMIT 20, 1;

<http://dev.mysql.com/doc/mysql/en/SELECT.html>

--
Cheers,
- Jacob Atzen
Jul 17 '05 #6
"Jacob Atzen" <ja***@aub.dk> a écrit dans le message de news:
sl******************@morpheus.aub.dk...
On 2005-01-19, Bob Bedford <be******@YouKnowWhatToDoHerehotmail.com>
wrote:
I've a page where I get the result of a query. Each result points to a
page where there is the detail of the record. I'd like to add
"previous" and "next"buttons. The only way I've found is to put the
results in an array, then on any page, the array will tell me the next
and previous record. It's there a better way using mysql ?


Offsets:

SELECT [...] FROM [table] LIMIT 20, 1;

<http://dev.mysql.com/doc/mysql/en/SELECT.html>

List.php (with limit 20):
<a href="detail.php?article=2>detail 2</a>
<a href="detail.php?article=3>detail 3</a>
<a href="detail.php?article=4>detail 4</a>
.....

Ok, once I click on article detail 3, how to make previous or next from
there since I'm on an other page and I don't run the query every time ? From
detail.php, it wouldn't be possible to go to 2 or 4 without coming back to
list.php.

Bob
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: pmud | last post by:
Hi I have a website (ASP.NET project using C# ) which is already put up on the server. I need to make some modification to some web pages.So the project files were copied to the a different server...
4
by: Mark J. McGinty | last post by:
Greets, Part of the content of one of our web pages uses wingdings and Chr(239) through Chr(242) (which are little arrow outlines, though that's not really important.) It worked just fine in...
4
by: dutch disCo | last post by:
Hi, I'm trying to use GET method to pass variables through my script files. Unfortunately, when a special char (&, ?, +) is being posted the variable gets trimmed in a very strange way. I'm...
13
by: baumann.Pan | last post by:
when define char *p = " can not modify"; p ='b' ;is not allowed, but if you declare p as char p = "can modify"; p = 'b'; is ok? why?
0
by: William Stacey [MVP] | last post by:
Had a method that got some string info from mp3 tags in N files and serializes this class and deserializes at other side. Works ok except sometimes get chars that choke the XmlSerializer. After...
2
by: A. Farber | last post by:
Hello, I'm programming a web application and for that I'm trying to extend the standard C string functions, so that they can handle the application/x-www-form-urlencoded format (which encodes...
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
2
by: Grzegorz Danowski | last post by:
Hello, I have made few reports in rdlc technology. They look and print fine, but if I export any report to pdf file I have some problems with polish specific chars: a. if I open pdf in...
8
by: s0suk3 | last post by:
Hi everyone, I've heard that a 'str' object is immutable. But is there *any* way to modify a string's internal value? Thanks, Sebastian
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.