-
Notifications
You must be signed in to change notification settings - Fork 0
Results
Adrian Preuß edited this page Jan 10, 2018
·
1 revision
API.fetch(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 an Array with Objects with the result.
API.fetch('SELECT * FROM `yourTable`', {}, function onSuccess(data) {
if(data === null) {
// Empty results...
return;
}
data.forEach(function(result) {
// Your result
});
});API.fetch('SELECT * FROM `yourTable` WHERE `gender`=:gender', {
gender: 'MALE'
}, function onSuccess(data) {
if(data === null) {
// Empty results...
return;
}
data.forEach(function(result) {
// Your result
});
});Created with 