What is the difference between bindParam and bindValue?

后端 未结 7 1260
一向
一向 2020-11-22 00:23

What is the difference between PDOStatement::bindParam() and PDOStatement::bindValue()?

相关标签:
7条回答
  • 2020-11-22 01:27

    You don't have to struggle any longer, when there exists a way lilke this:

    $stmt = $pdo->prepare("SELECT * FROM someTable WHERE col = :val");
    $stmt->execute([":val" => $bind]); 
    
    0 讨论(0)
提交回复
热议问题