Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. private function consultMySql(){
  2.  
  3. $cSQL = "SELECT SUM(CRIME.id), " .
  4. "PRIMARY_TYPE.Type " .
  5. "FROM CRIMES.CRIME " .
  6. "INNER JOIN PRIMARY_TYPE " .
  7. "ON CRIME.Type = PRIMARY_TYPE.id " .
  8. "WHERE Distric = ? AND " .
  9. "PRIMARY_TYPE.Type = ? " .
  10. "AND CRIME.anno = ?; " ;
  11.  
  12. if($this->stmt = $this->oConni->prepare($cSQL)){
  13. $this->stmt->bind_param('isi', $this->request["data"]["district"], $this->request["data"]["type"],$this->request["data"]["anno"] );
  14. $this->stmt->execute();
  15. $this->stmt->store_result();
  16. $this->stmt->bind_result($Total, $Type);
  17. while ($this->stmt->fetch()) {
  18. $this->data[] = array("Total" => $Total, "Type" => $Type);
  19. }
  20. }else{
  21. $this->stmt->error;
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement