Note that there are some explanatory texts on larger screens.

plurals
  1. POSanitizing text input before submitting to MySQL database
    primarykey
    data
    text
    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. CO1. That's nice, but use data correctly *at the use site* (i.e. encode when emitting HTML); 2. Prepared statements eliminate SQL injection but they *do not* eliminate using data incorrectly in other places (e.g. XSS, HTML, exec injection). Magic quotes were a bad idea that tried - and failed - to fix what #2 addresses. Business rule "sanitization" should be done, but for information correctness, and not [necessarily] data injection viewpoint.
      singulars
      1. This table or related slice is empty.
    2. CO@pst so I should do what everyone else is saying and use htmlspecialchars when outputting the input from the database? Will that interfere with CKEditor replacing HTML tags/symbols with their entities?
      singulars
    3. COYes, *always* encode output! (Except if there is a *really* good reason not to.) I personally *do not* encode input. Otherwise there is a blob of .. junk .. in the database. Store the information for what it *supposed* to be. While it might make sense to convert contents of an "rich text" editor into a normalized format (e.g. markdown/markup/bbcode), I would not recommend storing it "html encoded", as databases don't care about HTML. However, Business Rules might dictate that only `<em>` and `<a>` elements are allowed - now *this* should be enforced as it is *part* of the information.
      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