Created
January 6, 2012 20:20
-
-
Save joshsmith/1572237 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| var table = 'companies'; | |
| var Company = function() { | |
| } | |
| // Get company with just their email address | |
| Company.prototype.getByEmail = function (email, callback) { | |
| client.query( | |
| 'SELECT * FROM ' + table + | |
| ' WHERE email = ?', | |
| [ email ], | |
| function selectCb(err, results, fields) { | |
| if(err) { | |
| callback(err); | |
| } else { | |
| callback(null, results); | |
| } | |
| } | |
| ); | |
| } | |
| module.exports = Company; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment