HTML into MySQL db?

Discussion in 'MySQL' started by bryanw, Apr 1, 2008.

  1. #1
    Hello,

    I have a html file, and I want to insert it to Mysql db.

    For example, the content of html file,


    There are single quotes, double quotation marks etc...

    Is there any MySQL function to do the job?

    Thanks!
     
    bryanw, Apr 1, 2008 IP
  2. shafiq

    shafiq Well-Known Member

    Messages:
    132
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    u can do that throughout with myphpadmin
     
    shafiq, Apr 1, 2008 IP
  3. LittleJonSupportSite

    LittleJonSupportSite Peon

    Messages:
    386
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could encode and decode:


    
    <html>
    <body>
    <p>
    <?php
    
    $enc = mysql_query("SELECT ENCODE('testing','')");
    $str_enc = mysql_fetch_array($enc);
    $val_enc = $str_enc[0];
    echo $val_enc."<br>\n";
    
    $dec = mysql_query("SELECT DECODE('".$val_enc."','')");
    $str_dec = mysql_fetch_array($dec);
    $val_dec = $str_dec[0];
    echo $val_dec;
    
    ?>
    </p>
    
    </body>
    </html>
    
    Code (markup):
     
    LittleJonSupportSite, Apr 1, 2008 IP