SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot daveporter's Avatar
    Join Date
    Mar 2002
    Location
    Perth, Western Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Insert Into - need help

    Hi There,

    I purchased a script to do a one off transfer of data between two eCommerce solutions. It is all working fine except for the description for the products.
    The original looks something like this:
    HTML Code:
    <div style="text-align: center"><span
    (snippet)
    but after importing the resulting html looks like this
    HTML Code:
    &lt;div style=&quot;text-align: center&quot;&gt;&lt;span
    The line that does this has the following in front of the descriptions field "insert into"
    mysql_real_escape_string(htmlspecialchars($prs['products_description']))

    I've taken it out, but then I get errors when it hits a single quote somewhere in the html!
    Any thoughts on how to get around this ?
    TIA, Dave

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hi Dave.

    Change that line to...
    PHP Code:
    mysql_real_escape_string($prs['products_description']) 
    and you should be OK.

    Anthony.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Zealot daveporter's Avatar
    Join Date
    Mar 2002
    Location
    Perth, Western Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, worked a treat!
    Thanks so much !
    Dave


Bookmarks

Posting Permissions

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