Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get result sql server

//on sql server
public function get_data_from($id){
  $request = "SELECT * FROM yourTable 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;
}
 
PREVIOUS NEXT
Tagged: #php #result #sql #server
ADD COMMENT
Topic
Name
3+6 =