Jump to content

PHP/MSSQL find and replace help


DJ Unique

Recommended Posts

Hi,

 

I need some help finding and replacing content from a field in a mssql database. I have a mssql database called mp3_players. I have a column called web_content and in that column I have loads of XML text. Basically, I have the following XML stored in the web_content column:

 

 

<text id="0" guid="997ba35c-6a7a-4578-8076-2140b3c9e834" name="Description"><![CDATA[Apple iPod]]></text>

 

I want to be able to search web_content for the above line and store everything from name=" to </text> in a PHP variable. Then extract the description, whatever it might be, in this case its an Apple iPod, and store that as a separate variable. Then I want to replace the description with another variable that might be something like Apple iPod 80GB.

 

Any suggestions on how I can do this?

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.