Results 1 to 5 of 5
  1. #1
    Full Member
    Join Date
    January 18th, 2005
    Posts
    362
    My memory is like swiss cheese sometimes, will html cause problems in mysql string field? I'm working on the drivewerks feed and noticed a bunch of descriptions with tables in them that list specs of some items. Just when I thought I finally had it the way I wanted!

    If so.. I assume I can use in php to strip that stuff out? either completely or just tags? Or would I use some mysql function to do the stripping?

    I need to go into the php manual and start memorizing all the functions or something :P I went to bed last night mulling over how I would like to pass urls from the datafeed into a redirect script.. and woke up as if my brain did't stop thinking about how to structure this particular feed.

    No automation for me yet unless the feed is a friendly one I guess *sigh*.

  2. #2
    Member Speedy's Avatar
    Join Date
    January 18th, 2005
    Location
    Lancashire UK
    Posts
    165
    You can load HTML into MySQL as long as you strip out/escape the commas and quotes etc. But it sounds like you are not too confident yet with PHP/MySQL to do this so the easiest way for you is to do a search and replace in the actual feed before it gets to the database.

    If the Datafeed is in CSV format, simply open it in Excel and do a find and replace for the tags:

    Find <table> and Replace with a blank space. Do it with all the tags you want to replace.

    Or another way, load the lot into MySQL, run a ditty which just deletes all entries with the tags in. I wouldnt bother trying to memorise all the PHP functions, been using PHP for a few years now and still visit the function list regulary!
    --------------------------------------------------
    Life at the top is hard,
    But life at the bottom is harder ....

  3. #3
    Full Member
    Join Date
    January 18th, 2005
    Posts
    362
    any mysql or php functions you can recommend to do the stripping or escaping during import?

    I don't have excel, I've never bought a pre-assembled computer that came with software. I use some alternative spreadsheet from 602pc suite that has a free download.. but manual search and replace sounds like too much to do considering how many fields there are and how each description may have a different set of tags. table, font, list tags etc.. and stripping them out might just give a strange description where stuff that are supposed to be listed end up inline with no formatting.

  4. #4
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    ÄúsTrálíĺ
    Posts
    1,372
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Speedy:
    You can load HTML into MySQL as long as you strip out/escape the commas and quotes etc. <HR></BLOCKQUOTE>
    You don't need to strip anything.

    Use php command addslashes($var) and the data will be safe to insert.

    Use stripslashes($var) to go the other way.

  5. #5
    Full Member
    Join Date
    January 18th, 2005
    Posts
    362
    see.. that's what I mean about needing to really go over the available php functions in the manual.

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Can't Put Fields In Html Title, Keyword, and Description?
    By tfftff in forum WebMerge (Fourthworld.com)
    Replies: 8
    Last Post: September 16th, 2007, 09:01 AM
  2. Insertion of fields containing html codes
    By Pierre (aka Terdef) in forum WebMerge (Fourthworld.com)
    Replies: 4
    Last Post: June 28th, 2005, 10:09 AM
  3. Replies: 1
    Last Post: February 9th, 2005, 12:49 PM
  4. HTML in datafeed stays HTML in file?
    By Nintendo in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: August 17th, 2004, 10:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •