You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type of Database (MySQL, MSSQL, SQLite...): MariaDB
System (Liunx|Windows|Mac): Linux
Describe the Problem
I had some problem running a select query with LIKE operator: I noticed that when I passed more than 10 elements as argument of the LIKE clause there is an issue in replacing correctly said group of words in the generated query.
I don't know if it is a Medoo problem or it's a db side issue but I managed to fix it by slightly modifying the source code.
I show the problem in details.
Let's assume I have an array of 12 words I need to add to my WHERE clause using the LIKE operator.
Notice the last 2 elements: title LIKE '%two%'0 OR title LIKE '%two%'1
they are the first and the second words in the array, that's obviously not what I need.
the placeholder :MeD1_mKL10 is matched with :MeD1_mKL1 so it produces %two%0,
same for the other placeholder.
The fix I adopted is a simple modification to the index Medoo maps when the LIKE operator is used in the foreach at line 923,
In this way, placeholders have all 3 digits and the problem no longer exits.
I repeat, I'm not sure if it's a Medoo related issue or if I missed something in the configuration but you could take a look at the problem and perhaps take this issue into account by implementing a similar change.
Thank you.
PS. your library is really super useful!
The text was updated successfully, but these errors were encountered:
Information
Describe the Problem
I had some problem running a select query with LIKE operator: I noticed that when I passed more than 10 elements as argument of the LIKE clause there is an issue in replacing correctly said group of words in the generated query.
I don't know if it is a Medoo problem or it's a db side issue but I managed to fix it by slightly modifying the source code.
I show the problem in details.
Let's assume I have an array of 12 words I need to add to my WHERE clause using the LIKE operator.
The select statement is something like:
which produces the following output of the LIKE part:
which is ok and after substituting:
Notice the last 2 elements:
title
LIKE '%two%'0 ORtitle
LIKE '%two%'1they are the first and the second words in the array, that's obviously not what I need.
the placeholder :MeD1_mKL10 is matched with :MeD1_mKL1 so it produces %two%0,
same for the other placeholder.
The fix I adopted is a simple modification to the index Medoo maps when the LIKE operator is used in the foreach at line 923,
In this way, placeholders have all 3 digits and the problem no longer exits.
I repeat, I'm not sure if it's a Medoo related issue or if I missed something in the configuration but you could take a look at the problem and perhaps take this issue into account by implementing a similar change.
Thank you.
PS. your library is really super useful!
The text was updated successfully, but these errors were encountered: