Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To expand on the other answers:</p> <p>Basically you need make sure of two things:</p> <ol> <li><p>That you have room for the full amount of data that you want to insert in the field that you are trying to place it. Different database field types can fit different amounts of data. See: <a href="http://dev.mysql.com/doc/refman/5.0/en/string-types.html" rel="nofollow">MySQL String Datatypes</a>. You probably want the "TEXT" or "BLOB" types.</p></li> <li><p>That you are safely passing the data to database. Some ways of passing data can cause the database to "look" at the data and it will get confused if the data looks like SQL. It's also a security risk. See: <a href="http://en.wikipedia.org/wiki/SQL_injection" rel="nofollow">SQL Injection</a> </p></li> </ol> <p>The solution for #1 is to check that the database is designed with correct field type.</p> <p>The solution for #2 is use parameterized (bound) queries. For instance, instead of:</p> <pre><code># Simple, but naive, method. # Notice that you are passing in 1 large argument to db.execute() db.execute("INSERT INTO json_col VALUES (" + json_value + ")") </code></pre> <p>Better, use:</p> <pre><code># Correct method. Uses parameter/bind variables. # Notice that you are passing in 2 arguments to db.execute() db.execute("INSERT INTO json_col VALUES %s", json_value) </code></pre> <p>Hope this helps. If so, let me know. <strong>:-)</strong></p> <p>If you are still having a problem, then we will need to examine your syntax more closely.</p>
    singulars
    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. 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