$sql = $pdo->prepare("INSERT INTO test(name,city)VALUES(:vary,'china')");
$sql->bindParam('vary',$vary, PDO::PARAM_STR);
$vary=1234;
$sql->execute();
This should give error because i am not using string, for :vary
parameter . but this is working fine and insert a row in table test
. can someone explain why there is no error, i find same question on stackoverflow PHP PDO::bindParam() data types.. how does it work? But i am still confused, can someone PLEASE explain better..