how to insert HTML code into DB using php

前端 未结 6 2010
故里飘歌
故里飘歌 2020-12-11 12:40

i want to update my database with new html code this it the query:

UPDATE `Pages` SET `content`= \'
6条回答
  •  一生所求
    2020-12-11 13:11

    store your html content in one variable and use addslashes() when you are inserting it to database.

    $content='

    ...some words....

    .some words....

     

    ';

    and write your query as below

    UPDATE `Pages` SET `content`=addslashes($content);
    

    Hope this will help you :)

提交回复
热议问题