-
Notifications
You must be signed in to change notification settings - Fork 0
API: Single Result
Adrian Preuß edited this page Jan 10, 2018
·
3 revisions
API.single(statement, parameters, callback);| Variable | Default | Type | Description |
|---|---|---|---|
| statement | <MySQL-Query> |
String |
Your MySQL-Query |
| parameters | {} |
Object |
Parameters for your MySQL-Query |
| callback | <Callback> |
Function |
Callback with the result |
The data parameter on your Callback will return null if no rows/entries found or a Object with the single result.
API.single('SELECT * FROM `yourTable` WHERE `id`=:id', {
id: 1
}, function onSuccess(data) {
// Your result
});API.single('SELECT * FROM `yourTable` WHERE `col1`=:test AND `col2`=:time', {
test: 123,
time: 'NOW()'
}, function onSuccess(data) {
// Your result
});Created with 