<?php
include_once "Database.php";
$server="localhost";
$db="fantasy cricket";
$user="root";
$password="";
$db=new Database($server,$db,$user,$password);
$name=$_POST["name"];
$country=$_POST["country"];
$db->removePlayerFromTeam($name,$country);
This is the code that I am using to delete a row ,but the deletion is not working and database remains same .The removePlayerFromTeam($name,$country) is given below.When i use the query "delete from demo" ,that works and all rows get deleted,but when specifying column and value its not working. By echoing i get the desired values passed as parameter to the function.Please help me out what is going wrong. Thanks in advance.
public function removePlayerFromTeam($n,$cn)
{
echo "$n"."<br>"."$cn"."<br>";
$sql = sprintf("DELETE FROM demo WHERE Pname='%s' and country='%s'",$n,$cn);
$v=$this->connection->exec($sql);
if($v>0)echo "ok"."<br>";
else echo "wrong"."<br>";
}