Home >Backend Development >PHP Tutorial > sql语句的意思,该怎么处理

sql语句的意思,该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:32:10864browse

sql语句的意思
DB::query("SELECT COUNT(*) FROM ". DB::table('vgallerys')." where uid IN (SELECT 

pre_home_friend.fuid FROM pre_home_friend WHERE uid = '$discuz_uid') and album=0");
这句话的意思看不懂,求解。。。。。。。希望好心人帮助

------解决方案--------------------
就是返回符合条件的记录有多少条.
输出 sql 你就知道完整的内容是什么了.

echo "SELECT COUNT(*) FROM ". DB::table('vgallerys')." where uid IN (SELECT 

pre_home_friend.fuid FROM pre_home_friend WHERE uid = '$discuz_uid') and album=0";
------解决方案--------------------
找到vgallerys这个表中满足uid在“pre_home_friend这个表中uid等于$discuz_uid”范围内并且album=0的记录的总条数

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn