+ Post New Thread
Results 1 to 5 of 5
Web Development Thread, Inserting HTML into mySQL in Coding and Web Development; Hi, I am trying to add HTML into a mySQL database... The script is saying its gone it but its ...
  1. #1

    Join Date
    Sep 2008
    Location
    Oakham
    Posts
    31
    Thank Post
    14
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Inserting HTML into mySQL

    Hi,

    I am trying to add HTML into a mySQL database... The script is saying its gone it but its not in the database, however sometimes it works and sometimes it doesnt work.

    Anyone have any idea how I can fix this maybe I need some code to tell the mysql its html?

    Dan

  2. #2
    contink's Avatar
    Join Date
    Jul 2006
    Location
    South Yorkshire
    Posts
    3,791
    Thank Post
    303
    Thanked 327 Times in 233 Posts
    Rep Power
    118
    Can you output your table structure and highlight the fieldname you're storing the HTML in...

    It may simply be the incorrect choice of field type... You'll also be wanting to escape any input to avoid the SQL suffering a syntax error...

  3. #3
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,402
    Thank Post
    648
    Thanked 277 Times in 244 Posts
    Rep Power
    78
    What sort of HTML as well would be useful .. i.e. a web address or something more complicated to run, say, a CMS?

    From memory (and it has been a while) wrapping the field in " " tends to allow it in there better, but as contink said...

    Quote Originally Posted by contink View Post
    Can you output your table structure and highlight the fieldname you're storing the HTML in...

  4. #4
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,438
    Thank Post
    120
    Thanked 263 Times in 189 Posts
    Rep Power
    72
    Certainly worth running the input through addslashes() and use stripslashes() when you retrieve it to escape characters that could cause you grief.

  5. Thanks to SteveBentley from:

    Danny159 (19th May 2010)

  6. #5

    Join Date
    Sep 2008
    Location
    Oakham
    Posts
    31
    Thank Post
    14
    Thanked 1 Time in 1 Post
    Rep Power
    0
    This worked thanks for you help again guys

    Dan

SHARE:
+ Post New Thread

Similar Threads

  1. SIMS register inserting 'N's
    By sparkeh in forum MIS Systems
    Replies: 19
    Last Post: 11th October 2010, 08:22 AM
  2. Inserting a slideshow into Joomla
    By dezt in forum Web Development
    Replies: 7
    Last Post: 27th January 2009, 11:57 AM
  3. Inserting a link in one article to another
    By reggiep in forum EduGeek Joomla 1.5 Package
    Replies: 1
    Last Post: 27th June 2008, 10:34 PM
  4. Inserting Flash Videos
    By Singist in forum EduGeek Joomla 1.5 Package
    Replies: 6
    Last Post: 7th June 2008, 07:58 AM
  5. Inserting a link into an image
    By roo20487 in forum Web Development
    Replies: 2
    Last Post: 30th January 2008, 09:36 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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