A
A
Abdulla Timershin2020-01-22 16:59:55
MySQL
Abdulla Timershin, 2020-01-22 16:59:55

Why does Query Builder formulate the query incorrectly?

I use the query builder Query Builder for SphinxQL . Gives the error "[1064] You have an error in your SQL syntax". And the query itself is obtained from the Query Builder
like this: "SELECT title FROM userads WHERE MATCH('(@title searchtext)') AND active = 1". Namely, it swears at the part "MATCH('(@title subject)') ".
I understand that it is correct to write MATCH (`title`) AGAINST ('$searchtext'). But why is the builder composing the request incorrectly?
Here is my request:

$query = (new SphinxQL($conn))->select('title')
    ->from('userads')
    ->match('title', 'searchtext')
  ->where('active', '=', 1);

$result = $query->execute();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2020-02-23
@2ord

Ask the author of this package

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question