Connecting Tech Pros Worldwide Help | Site Map

modify chars in files

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 10:48 AM
Bob Bedford
Guest
 
Posts: n/a
Default 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



  #2  
Old July 17th, 2005, 10:48 AM
Hartmut Holzgraefe
Guest
 
Posts: n/a
Default Re: modify chars in files

Bob Bedford wrote:[color=blue]
> 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 ?[/color]

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
  #3  
Old July 17th, 2005, 10:48 AM
Bob Bedford
Guest
 
Posts: n/a
Default Re: modify chars in files


"Hartmut Holzgraefe" <hartmut@mysql.com> a écrit dans le message de news:
csl9bp$ubv$2@online.de...[color=blue]
> Bob Bedford wrote:[color=green]
>> 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 ?[/color]
>
> 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
>[/color]
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


  #4  
Old July 17th, 2005, 10:48 AM
Hartmut Holzgraefe
Guest
 
Posts: n/a
Default Re: modify chars in files

Bob Bedford wrote:[color=blue]
> 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[/color]

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.
[color=blue]
> 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.[/color]

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
  #5  
Old July 17th, 2005, 10:48 AM
Bob Bedford
Guest
 
Posts: n/a
Default Re: modify chars in files

> 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


  #6  
Old July 17th, 2005, 10:48 AM
Jacob Atzen
Guest
 
Posts: n/a
Default Re: modify chars in files

On 2005-01-19, Bob Bedford <bedford1@YouKnowWhatToDoHerehotmail.com> wrote:[color=blue]
> 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 ?[/color]

Offsets:

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

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

--
Cheers,
- Jacob Atzen
  #7  
Old July 17th, 2005, 10:49 AM
Bob Bedford
Guest
 
Posts: n/a
Default Re: modify chars in files

"Jacob Atzen" <jacob@aub.dk> a écrit dans le message de news:
slrncusnva.9mt.jacob@morpheus.aub.dk...[color=blue]
> On 2005-01-19, Bob Bedford <bedford1@YouKnowWhatToDoHerehotmail.com>
> wrote:[color=green]
>> 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 ?[/color]
>
> Offsets:
>
> SELECT [...] FROM [table] LIMIT 20, 1;
>
> <http://dev.mysql.com/doc/mysql/en/SELECT.html>
>[/color]
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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.