Guest User

Untitled

a guest
May 16th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public function getPort($id) {
  2. $sql = "SELECT c.id, c.port as number, d.type, d.spec, d.transfer as speed
  3. FROM details a
  4. LEFT JOIN port_to_drive b ON a.drive_id = b.drive_id
  5. LEFT JOIN port c ON b.port_id = c.id
  6. LEFT JOIN port_type d ON c.port_type = d.id
  7. WHERE a.id = $id";
  8.  
  9. $stmt = $this->db->query($sql);
  10.  
  11. return $stmt->fetchObject();
  12. }
  13.  
  14. object(stdClass)[116]
  15. public 'id' => null
  16. public 'number' => null
  17. public 'type' => null
  18. public 'spec' => null
  19. public 'speed' => null
  20.  
  21. PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
  22. PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
  23. PDO::ATTR_EMULATE_PREPARES => false
Add Comment
Please, Sign In to add comment