Last active
August 29, 2015 14:02
-
-
Save dmulvi/1eb14c22e4c3f3823133 to your computer and use it in GitHub Desktop.
The class method that actually returns the LEFT OUTER JOIN results.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will pull out our results inserted on Task 1 and display them in a table. | |
*/ | |
public function pull_twitter_users() | |
{ | |
try { | |
$sql = "SELECT f.id, f.screen_name, l.location | |
FROM followers AS f | |
LEFT OUTER JOIN location AS l | |
ON l.id = f.id | |
LIMIT 100"; | |
$stmt = $this->db->prepare($sql); | |
$stmt->execute(); | |
$result = $stmt->fetchAll(); | |
echo json_encode($result); | |
} | |
catch (PDOException $e) { | |
echo $e->getMessage(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment