catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.84k stars 1.15k forks source link

medoo where use of external conditions #456

Closed hiepdung closed 6 years ago

hiepdung commented 8 years ago

I do not know use the external conditions for Medoo

`<?php

    if($a=1) {          $where0= '"a" => "'.$a0001.'",';} else {            $where0= '"a" => "'.$a0002.'",';}
    if($b=1) {          $where1= '"b" => "'.$b0001.'",';} else {            $where1= '"b" => "'.$b0002.'",';}
    if($c=1) {          $where2= '"c" => "'.$c0001.'",';} else {            $where2= '"c" => "'.$c0002.'",';}
    if($d=1) {          $where3= '"d" => "'.$a0001.'",';} else {            $where3= '"d" => "'.$d0002.'",';}
    if($e=1) {          $where4= '"e" => "'.$a0001.'",';} else {            $where4= '"e" => "'.$e0002.'",';}

    $mask = $where0.$where1.$where2.$where3.$where4;
    `$database[17]->select("mytable","*",["AND"=>[$mask]]);``

Please help me

catfan commented 6 years ago

Check out the new feature raw object https://medoo.in/api/raw.