HTML into MySQL -beginner question.

Discussion in 'MySQL' started by wolfie, Dec 19, 2009.

  1. #1
    I've been browsing web for a week now to figure how to import HTML codes into MySQL db.
    As far, I have found tons of information but problem is that I either don't understand it or it won't work. ( bets for the first one. )

    So that's why I'm here now. Hoping to get an example about data below.
    I use php My Admin to manage databases.
    (Hope this forum code function does no modify code during post.)

    INSERT INTO `jos_content` (`id`, `title`, `alias`, `title_alias`, `introtext`, `fulltext`, `state`, `sectionid`, `mask`, `catid`, `created`, `created_by`, `created_by_alias`, `modified`, `modified_by`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `images`, `urls`, `attribs`, `version`, `parentid`, `ordering`, `metakey`, `metadesc`, `access`, `hits`, `metadata`) VALUES(, 'Basket Shooting', '', '', '<p class=description>Click the button to shoot to the moving basket. Get the points as much as you can.</p> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="350" /><param name="movie" value="http://www.fry5.com/Annie/52.swf" /><param name="quality" value="high" /><embed src="http://www.fry5.com/Annie/52.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="350" /></embed></object>', '', 1, 5, 0, 34, '2009-12-19 13:46:18', 62, '', '0000-00-00 00:00:00', 0, 0, '0000-00-00 00:00:00', '2009-05-18 13:26:16', '0000-00-00 00:00:00', '', '', 'show_title=\nlink_titles=\nshow_intro=\nshow_section=\nlink_section=\nshow_category=\nlink_category=\nshow_vote=\nshow_author=\nshow_create_date=\nshow_modify_date=\nshow_pdf_icon=\nshow_print_icon=\nshow_email_icon=\nlanguage=\nkeyref=\nreadmore=', 1, 0, 18, 'Basket Shooting', 'Use the mouse to control the direction of the hand. And click the button to shoot to the moving basket. Get the points as much as you can.', 0, 167, 'robots=\nauthor=');
    Code (markup):
     
    wolfie, Dec 19, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    You can insert html in mysql very much like any other text. All you need to do is take care of reserved characters. Specially (') Apostrophe.
     
    mastermunj, Dec 20, 2009 IP
  3. hemant.yadav

    hemant.yadav Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    When ever insert the html code take care of ' Apostrophe. character or do simple replace this Apostrophe character with Double Apostrophe and you will able to insert the code into database other wise you will face the problem that coloum doesn't match.
    i did it in my asp.net c# code and its working fine in my case i am using MySqL 5.1
     
    hemant.yadav, Jan 1, 2010 IP