关于pdo的一个疑问,该如何解决
关于pdo的一个疑问
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> if (isset($_POST['loginName']) && isset($_POST['pwd']) && $_POST['action'] == 'submit') { $loginName = $_POST['loginName']; $pwd = $_POST['pwd']; echo $loginName.' '.$pwd; $sql = "SELECT COUNT(*) FROM tb_esq WHERE login_name = :loginName AND pwd = :pwd"; require_once ('conn.php'); $sth = $db->prepare($sql); $sth->bindParam(':loginName', $loginName, PDO::PARAM_STR, 25); $sth->bindParam(':pwd', $pwd, PDO::PARAM_STR, 25); $sth->execute(); $rowCount = $sth->fetchColumn(); var_dump($rowCount);//一直是0 $db = NULL; if ($rowCount == 1) { echo "<script>window.location=\"index.html\";</script>"; } else { alert('用户名或密码错误!'); echo "<script>window.location=\"login.php\";</script>"; } }
在提交了数据库中存在的用户名和密码之后还是提示密码错误,为什么呢
------解决方案--------------------
先用普通查询 看能否得到数据
- PHP code
$sql = "SELECT COUNT(*) FROM tb_esq WHERE login_name = '$loginName' AND pwd = '$pwd'"; $result = $db->query($sql); $row = $result->fetch(PDO::FETCH_ASSOC); print_r($row); <div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

Why Snipping Tool Not Working on Windows 11 Understanding the root cause of the problem can help find the right solution. Here are the top reasons why the Snipping Tool might not be working properly: Focus Assistant is On: This prevents the Snipping Tool from opening. Corrupted application: If the snipping tool crashes on launch, it might be corrupted. Outdated graphics drivers: Incompatible drivers may interfere with the snipping tool. Interference from other applications: Other running applications may conflict with the Snipping Tool. Certificate has expired: An error during the upgrade process may cause this issu simple solution. These are suitable for most users and do not require any special technical knowledge. 1. Update Windows and Microsoft Store apps

Part 1: Initial Troubleshooting Steps Checking Apple’s System Status: Before delving into complex solutions, let’s start with the basics. The problem may not lie with your device; Apple's servers may be down. Visit Apple's System Status page to see if the AppStore is working properly. If there's a problem, all you can do is wait for Apple to fix it. Check your internet connection: Make sure you have a stable internet connection as the "Unable to connect to AppStore" issue can sometimes be attributed to a poor connection. Try switching between Wi-Fi and mobile data or resetting network settings (General > Reset > Reset Network Settings > Settings). Update your iOS version:

Script means script or script. In film, television, drama and other art forms, script is used to describe the dialogue, actions and scenes of characters, as well as the development and structure of the story. Script writing requires certain skills and experience, and it should be vivid and powerful, capable of attracting the audience's attention and conveying the emotions and themes of the story. Scripts are particularly important in the film and television industries. They are the basis of creation and determine the storyline, character development and dialogue content of the film. Script is an important tool for artists to create and express themselves.

pwd in Linux means a common command in Linux. It is a command commonly used by Linux system administrators and ordinary users. It can help users quickly find the current directory, facilitate users to better manage files and directories, and can also help administrators and Users can quickly locate certain specific directories or files to better manage the Linux system.

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

In the field of computer science, "script" usually refers to a scripting language or script file. A scripting language is an interpreted programming language commonly used for tasks such as automation, batch processing, and rapid prototyping.

Solutions to scripterror include checking syntax, file path, checking network connection, browser compatibility, using try-catch statements, using developer tools for debugging, updating browsers and JavaScript libraries, or seeking professional help. Detailed introduction: 1. Check for syntax errors: Script Error may be caused by syntax errors in JavaScript code. Use developer tools to check the code and fix syntax errors. Make sure that the brackets, quotation marks, semicolons, etc. in the code are correct. etc.
