<?php
header("Content-type:text/html;charset=utf8");
$password=$_POST["password"];
$username=$_POST["username"];
try{
$dsn="mysql:host=localhost;dbname=test";
$user="root";
$pass="360wmlssw";
$pdo=new PDO($dsn,$user,$pass);
$sql="delete * from test where user=:username and password=:password";
$stmt=$pdo->prepare($sql);
$stmt->bindParam(":username",$username);
$stmt->bindParam(":password",$password);
$stmt->execute();
echo $stmt->rowCount();
}
catch(PDOException $e)
{
echo $e->getMessage();
}
//各位大神,为什么我的语句输出为0啊,我的数据库有这条记录啊