我想获得一个mysql查询的布尔输出.
我发出如下的查询
EXISTS (
select 1
from someothertable
where someaccid = (
select someid
from smtable
where username = 'someuser'
and password = 'somepassword')
)
Run Code Online (Sandbox Code Playgroud)
这会1064在mysqlshell中返回一个错误并返回一个bool false php mysqli.
如何使用EXISTS命令获得输出为bool ?
提前致谢.
用途SELECT:
SELECT EXISTS (select 1
from someothertable
where someaccid = (select someid
from smtable
where username = 'someuser' and
password = 'somepassword'))
Run Code Online (Sandbox Code Playgroud)
1如果EXISTS成功则返回,0否则返回.