我有一个防火墙数据库,它与移动应用程序和web应用程序都链接在一起。我正在开发这个web应用程序,我对PHP和AJAX很在行,所以我想知道是否存在使用PHP和AJAX的防火墙数据库,或者是否有任何方法将其与SQLdatabase连接。
发布于 2017-12-17 13:33:04
您可以从web应用程序的javascript端使用Firebase JS。
例如,您可以使用PHP代码提供的ID从数据库(Realtime或Firestore)获得一个对象:
var itemid = <?php echo $user->itemid ?>
// i.e. read once from Realtime Database
firebase.database().ref('items/' + itemid).once('value')
.then(snapshot => {
var item = snapshot.val();
})
.catch(error => console.log(error.code));
// i.e. read once from Firestore
firebase.firestore().collection('items').doc(itemid).get()
.then(doc => {
var item = doc.exists ? doc.data() : null;
})
.catch(error => console.log(error));
https://stackoverflow.com/questions/47844785
复制相似问题