📜  php 从准备好的选择中获取数据 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:46.676000             🧑  作者: Mango

代码示例1
//on sql server
public function get_data_from($id){
  $request = "SELECT * FROM tableName WHERE id = ?";

  //preparing the request
  $stmt = $this->dbh->prepare($request);

  //executing the request
  $stmt->execute( array($id)  );

  //fetching the result of the request
  $result = $stmt->fetchAll();

  return $result;
}