Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Senior Member
    Join Date
    Aug 2011
    Posts
    217
    Member #
    29153
    Liked
    4 times

    How do I save code in a database and have it spit it back out without changing it?

    I am copying code from a site that generates it for me to use as an affiliate to selling items. Sometimes the code gets changed and what I see in the end result isn't what I started with. I'm using php and mysql.

  2.  

  3. #2
    Senior Member
    Join Date
    Aug 2011
    Posts
    217
    Member #
    29153
    Liked
    4 times
    Looks like the problem is with the ampersand.

    It is saving it in the database as just & but somehow it is echoing it out as &

    How do I fix this?

  4. #3
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Location
    Serbia
    Posts
    274
    Member #
    40099
    Liked
    47 times

  5. #4
    Member
    Join Date
    Jun 2015
    Location
    UK
    Posts
    68
    Member #
    50099
    Liked
    12 times
    What column type are you using to store the urls? Try nvarchar(max) to avoid it from encoding the characters in the url or cutting them short

  6. #5
    Senior Member
    Join Date
    Aug 2011
    Posts
    217
    Member #
    29153
    Liked
    4 times
    Quote Originally Posted by Studio87 View Post
    What column type are you using to store the urls? Try nvarchar(max) to avoid it from encoding the characters in the url or cutting them short
    Are you talking about in the database itself or on the web page? It does not give me that option in my database.

  7. #6
    Senior Member
    Join Date
    Aug 2011
    Posts
    217
    Member #
    29153
    Liked
    4 times
    Now I have discovered that if I only have a few of these on a page they are fine but when I start having several some start messing up. What could be causing this?

  8. #7
    Member
    Join Date
    Jun 2015
    Location
    UK
    Posts
    68
    Member #
    50099
    Liked
    12 times
    Are you inputting the url to the database yourself? Or do you have a script populating it?
    Im a little confused to what you have running here

  9. #8
    Senior Member
    Join Date
    Aug 2011
    Posts
    217
    Member #
    29153
    Liked
    4 times
    This is what the code looks like:

    <iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdH tml&MarketPlace=US&source=ss&ref=ss_til&ad_type=pr oduct_link&tracking_id=campscorne-20&marketplace=amazon&region=US&placement=B00OW6MB 6O&asins=B00OW6MB6O&linkId=7WJMSNKLBIG5XLOW&show_b order=true&link_opens_in_new_window=true">
    </iframe>

  10. #9
    Member
    Join Date
    Jun 2015
    Location
    UK
    Posts
    68
    Member #
    50099
    Liked
    12 times
    So thats the URL you are using? Im trying to grasp what it is you are doing. You mentioned a database, how are you populating it? And then calling it?

  11. #10
    Senior Member
    Join Date
    Aug 2011
    Posts
    217
    Member #
    29153
    Liked
    4 times
    I think have have narrowed down the problem. When I edit it, I have the description in a text area and when I have something like &reg it shows up as so when I save my edit, it changes things like this.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:22 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com