1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[SQL] MySQL query String contains

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 25, 2021.

  1. Stack

    Stack Membro Participativo

    I've been trying to figure out how I can make a query with MySQL that checks if the value (string $haystack ) in a certain column contains certain data (string $needle), like this:

    SELECT *
    FROM `table`
    WHERE `column`.contains('{$needle}')

    In PHP, the function is called substr($haystack, $needle), so maybe:

    WHERE substr(`column`, '{$needle}')=1

    Continue reading...

Compartilhe esta Página