Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you submit this data to the database, please take a look at the escape functions for your database.</p> <p>That is, for MySQL there is <a href="http://php.net/mysql_real_escape_string" rel="noreferrer">mysql_real_escape_string</a>.</p> <p>These escape functions take care of any characters that might be malicious, and you will still get your data in the same way you put it in there.</p> <p>You can also use prepared statements to take care of the data:</p> <pre><code>$dbPreparedStatement = $db-&gt;prepare('INSERT INTO table (htmlcontent) VALUES (?)'); $dbPreparedStatement-&gt;execute(array($yourHtmlData)); </code></pre> <p>Or a little more self explaining:</p> <pre><code>$dbPreparedStatement = $db-&gt;prepare('INSERT INTO table (htmlcontent) VALUES (:htmlcontent)'); $dbPreparedStatement-&gt;execute(array(':htmlcontent' =&gt; $yourHtmlData)); </code></pre> <p>In case you want to save different types of data, use <code>bindParam</code> to define each type, that is, an integer can be defined by: <code>$db-&gt;bindParam(':userId', $userId, PDO::PARAM_INT);</code>. Example:</p> <pre><code>$dbPreparedStatement = $db-&gt;prepare('INSERT INTO table (postId, htmlcontent) VALUES (:postid, :htmlcontent)'); $dbPreparedStatement-&gt;bindParam(':postid', $userId, PDO::PARAM_INT); $dbPreparedStatement-&gt;bindParam(':htmlcontent', $yourHtmlData, PDO::PARAM_STR); $dbPreparedStatement-&gt;execute(); </code></pre> <p>Where <code>$db</code> is your PHP data object (PDO). If you're not using one, you might learn more about it at <em><a href="http://php.net/book.pdo" rel="noreferrer">PHP Data Objects</a></em>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload