• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

php-PHP中mysql_num_rows问题

mysql 搞代码 4年前 (2022-01-09) 12次浏览 已收录 0个评论

mysqlphp数据库

<code> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>注册</title><?php    if(isset($_POST["Submit"]) && $_POST["Submit"] == "注册")    {        $user = $_POST["username"<div>本文来源gaodai.ma#com搞#代!码网_</div>];        $psw = $_POST["password"];        $psw_confirm = $_POST["confirm"];        if($user == "" || $psw == "" || $psw_confirm == "")        {            echo "<script>alert('请确认信息完整性!'); history.go(-1);</script>";        }        else        {            if($psw == $psw_confirm)            {                mysql_connect("localhost","root","");   //连接数据库                mysql_select_db("用户表");   //选择数据库                mysql_query("set names 'gdk'"); //设定字符集                $sql = "select username from user where username = '$_POST[username]'"; //SQL语句                $result = mysql_query($sql);    //执行SQL语句                $num = mysql_num_rows($result);</code>
<code> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>登陆</title><?php    if(isset($_POST["submit"]) && $_POST["submit"] == "登陆")    {        $user = $_POST["username"];        $psw = $_POST["password"];        if($user == "" || $psw == "")        {            echo "<script>alert('请输入用户名或密码!'); history.go(-1);</script>";        }        else        {            mysql_connect("localhost","root","");            mysql_select_db("用户表");            mysql_query("set names 'gbk'");            $sql = "select username,password from user where username = '$_POST[username]' and password = '$_POST[password]'";            $result = mysql_query($sql);            $num = mysql_num_rows($result);</code>

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php-PHP中mysql_num_rows问题
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址