mysql_num_rows()函数,该如何处理

WBOY
Release: 2016-06-13 12:42:04
Original
934 people have browsed it

mysql_num_rows()函数

以下是代码部分:
$username=$_POST["name"];
$password=$_POST["password"];
if($username&&$password)
{
if(strpos($username," ")!==false)echo "用户名非法";
else
{
$con=mysql_connect("localhost","root","1");
mysql_select_db("manage",$con);
$sql="
select password
from user
where username='$username'
";
$query=mysql_query($sql);
$row=mysql_num_rows($query);
if($row!=0)echo'登录成功';
  else
  echo '登录失败';
}
}
?>

php MySQL
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!