A
A
andrr252018-11-15 22:45:08
PHP
andrr25, 2018-11-15 22:45:08

Error in sql like?

There is this code:

$search_name = $_GET['search-text'];
    $searching = $pdo->query("SELECT * FROM salones WHERE service_name = LIKE '%$search_name%'");
    $fetch = $searching->fetch();

gives error: Fatal error: Uncaught Error: Call to a member function fetch() on boolean in C:\OSPanel\domains\salon\salones\index.php:111 Stack trace: #0 {main} thrown in C:\OSPanel \domains\salon\salones\index.php on line 111
Please tell me how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
1001001, 2018-11-15
@andrr25

SELECT * FROM salones WHERE service_name LIKE '%$search_name%'

equals lichen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question