$user= NewModel ("User");
// string Condition Query
Var_dump($user->where (' id=42 and username= ' Bnbbs ')->select ());
$map[' id ']=1;
$map[' username ']="Bnbbs";
$map[' Email ']="[email protected]";
$map[' _logic ']=' OR ';
// array condition query array with the key named_logicthe value in the element is' OR 'then useORLinks
Var_dump($user->where ($map)->select ());
//StdClassis aPHPA built-in class that can be understood as an empty class, where the condition field is understood asMapThe member of the object, where the\is to set the command space to the root directory, otherwise this class cannot be found
//thinkphpthink of the array as the object query effect,thinkphpWe recommend using array mode
$map= New\stdclass ();
$map -ID=1;
$map -username="Bnbbs";
$map -_logic=' OR ';
Var_dump($user->where ($map)->select ());
thinkphp Basic Learning Simple condition query