Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://dev.mysql.com/doc/refman/5.0/en/pattern-matching.html" rel="nofollow">Quotes should be around <code>%</code></a> not inside them, like <code>LIKE('%$input%')</code>. Note that whatever string comparison you use it's dependant on whether <a href="http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html" rel="nofollow">collation is case sensitive or insensitive</a>:</p> <blockquote> <p>The default character set and collation are latin1 and latin1_swedish_ci, so nonbinary string comparisons are case insensitive by default. This means that if you search with col_name LIKE 'a%', you get all column values that start with A or a.</p> </blockquote> <p><a href="http://php.net/manual/en/changelog.mysql.php" rel="nofollow"><code>mysql_</code></a> is deprecated, use <a href="http://php.net/manual/en/book.mysqli.php" rel="nofollow"><code>mysqli_</code></a> or <a href="http://php.net/manual/en/book.pdo.php" rel="nofollow"><code>PDO::</code></a>.</p> <p>You're not escaping input (<a href="http://php.net/manual/en/security.database.sql-injection.php" rel="nofollow">SQL Injection</a>).</p> <p><del>You're declaring <code>$inpput</code> and using <code>$input</code>.</del></p> <p>Also check <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html" rel="nofollow"><code>FULLTEXT</code> search options in MySQL</a> for speed optimization.</p> <p>Or if you need to match whole words <strong>only</strong> you may use <a href="http://dev.mysql.com/doc/refman/5.1/en/regexp.html" rel="nofollow"><code>REGEXP</code></a> like this:</p> <pre><code>SELECT * FROM test WHERE sentence REGEXP '([^[:alnum:]]|^)$input([^[:alnum:]]|$)' </code></pre> <p><a href="http://pastebin.com/PANtzKtv" rel="nofollow">Example here</a><sub>1</sub> where <code>[^[:alnum:]]</code> matches everything except number and letters (coma, full stop, dash) and <code>^/$</code> beginning/end of the string respectively.</p> <p><sub> [<strong>1</strong>] just pastebin, <a href="http://sqlfiddle.com/" rel="nofollow">sqlfiddle</a> is down right now :-/ </sub></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. VO
      singulars
      1. This table or related slice is empty.
    2. 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