Home > Backend Development > PHP Tutorial > 小白表示不太懂这段代码的含义,求大神指导

小白表示不太懂这段代码的含义,求大神指导

WBOY
Release: 2016-06-20 12:30:57
Original
782 people have browsed it

$sql="select * from waxx_admin where account='{$account}'";  

$rs=mysql_query($sql); 

$num=mysql_num_rows($rs); 

想知道每一步都在干什么,有点晕


回复讨论(解决方案)

sql 语句,查询 表waxx_admin 中字段 account 值 等于 $account 的数据

执行sql 语句,返回的结果存在 $rs 中

取得结果集中行的数目,返回的结果存在 $num 中

多看看手册....

$sql="select * from waxx_admin where account='{$account}'";  
设定查询语句,语句意思是查询waxx_admin表中account等于$account这个变量的所有记录

$rs=mysql_query($sql); 
执行查询

$num=mysql_num_rows($rs); 
获取查询返回的记录条数

楼上真6666666666,完全正确

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template