Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Though you don't specify the error you're receiving, I'm guessing that it has to do with not-escaping the quotes in your query, specifically (but not limited to), the <code>comment</code> column.</p> <p>For example, the column in your sample is:</p> <blockquote> <p>Go to class. He doesn't require it but it will make the difference between an A or a B. It's very difficult to do anything without being in class. He gives all the answers you need so long as you show up. He's a very good teacher and I would recommend him to someone else</p> </blockquote> <p>This text includes several single-quotes, which will break your SQL query and give you an error.</p> <p>You're using <a href="http://php.net/htmlentities" rel="nofollow"><code>htmlentities</code></a> on each column's input, however, this does not prevent SQL injection; and, by default, <code>htmlentities</code> also doesn't convert single-quotes.</p> <p>I don't know what MySQL library your database class is implementing, but you may want to try using the library's escaping functions.</p> <p>For instance, if you're using the older <code>mysql_</code> functions, use <a href="http://php.net/mysql_real_escape_string" rel="nofollow"><code>mysql_real_escape_string()</code></a> instead of <code>htmlentities()</code> for each value. On the other hand, if you're using the more-recommended <a href="http://php.net/manual/en/book.mysqli.php" rel="nofollow">MySQLi</a> or <a href="http://php.net/manual/en/book.pdo.php" rel="nofollow">PDO</a> classes, convert your query to be a prepared statement instead.</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. This table or related slice is empty.
    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