Add IN and NOT IN in WHERE clause
But on right side use only RAW.
There is it
https://github.com/catfan/Medoo/blob/master/src/Medoo.php#L903 https://github.com/catfan/Medoo/blob/master/src/Medoo.php#L989
But your solution don't solve like this
select * from table1 where id not in (select id2 from table2)
My solution can also solve your problem, and it is more
https://github.com/catfan/Medoo/pull/1003
$this->database->select( "account", "user_name", [ Medoo::raw("
not in (select id2 from table2) "), 'LIMIT' => [20, 100], "ORDER" => "user_id", ] );
My solution can also solve your problem, and it is more
[
Medoo::raw(" not in (select id2 from table2) "),
need key on first row of this array:
PHP Fatal error: Uncaught TypeError: preg_match() expects parameter 2 to be string, object given in Medoo.php:859
You tested this ?
Please correct me, but on this :
$a = $database->select("company", '*', [
'ID'=> Medoo::raw(" not in (select company_id from table2)"),
]);
I recive this SQL:
SELECT * FROM "company" WHERE "ID" = not in (select company_id from table2)
My solution can also solve your problem, and it is more
[ Medoo::raw(" not in (select id2 from table2) "),need key on first row of this array:
PHP Fatal error: Uncaught TypeError: preg_match() expects parameter 2 to be string, object given in Medoo.php:859You tested this ?Please correct me, but on this :
$a = $database->select("company", '*', [ 'ID'=> Medoo::raw(" not in (select company_id from table2)"), ]);I recive this SQL:
SELECT * FROM "company" WHERE "ID" = not in (select company_id from table2)
Use the master branch in my repository to modify, and you have to write this
$a = $database->select("company", '*', [ Medoo::raw("<ID> not in (select company_id from table2)"), ]);
Use the master branch in my repository to modify, and you have to write this
thank you, I already used my solution in small project and try to share to another people to help