从iPhone应用程序访问wordpress数据库 [英] Acessing a wordpress database from an iPhone App

查看:147
本文介绍了从iPhone应用程序访问wordpress数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被要求创建一个应用程序,它将从CMS将是Wordpress的数据库中获取数据。我从来没有使用过CMS,所以我试图在我的脑海中获得一个(概述)图片,它将如何工作以及每个组件将是什么。 CMS实际上为派对带来了什么。

I've been asked to create an app that will get data back from a database where the CMS will be Wordpress. I've never used a CMS so I'm trying to get a (overview)picture in my head of how it could all work and what each of the components would be. And what a CMS actually brings to the party.

创建应用程序本身非常清楚。我已经做了一些。我以前做过数据库,不应该引起问题。

Creating the app itself is pretty clear. I've done a few already. I've made a database before and shouldnt cause a problem.

但应用程序和数据库之间的中间是什么?

But what is going to be in the middle between the app and the database?

A部分:
我猜iphone应用程序通常会调用一些托管在服务器上的php文件?然后php将调用数据库并以某种方式返回数据,可能是xml。但这是非常基本的,不需要CMS。只是一个数据库和一个phpfile,或者我错了?

Part A: I'm guessing iphone apps typically would call some php file that's hosted on the server? The php then would make a call to the database and return the data somehow, maybe as xml. But this is really basic and wouldnt require a CMS. Just a database and a phpfile, or am I wrong?

B部分:
如果我想每分钟对数据库进行一次检查,看是否有任何问题数据库中的数据不再有效,并在需要时将其删除,这将需要在服务器上运行某些程序。因此,该程序将是Wordpress,因为它正在管理内容,因此实际上需要内容管理系统并且用于这些类型的任务。我了解CMS的作用吗?

Part B: If i wanted to run a check on the database every minute to see if any of the data in database was no longer valid and remove it if needed, that would require somekind of program running on the server. So that program would be Wordpress, since it is managing the content, so a content management system is actually needed and is for these kind of taskes. Am i understanding the role of CMS?

非常感谢,
-Code

Many Thanks, -Code

推荐答案

A部分:是的,这肯定是正常工作的方式。当然,你没有访问a数据库,你正在访问WordPress创建的数据库,但是,确实如此。

Part A: Yes, that's definitely how it would normally work. Of course, you're not accessing "a" database, you're accessing the database WordPress creates, but otherwise, sure.

B部分:CMS的作用是提供一种结构化,易于编辑的信息呈现方式。它抽象了数据库和用户界面的内容,允许CMS管理员通过使用简单的表单来获取CRUD数据。

Part B: The role of a CMS is to provide a structured, easily-edited way of presenting information. It abstracts both the database and the user interface stuff, allowing the CMS administrator to CRUD data via the use of simple forms.

在你的情况下,不,你不会(通常)要求WordPress软件提供信息,因为它没有设置为提供以编程方式请求的数据。相反,它旨在显示嵌入了数据的HTML页面。 WordPress软件专门为人类通过人性化界面CRUD数据。你可以写自己的,如A部分所示。

In your case, no, you wouldn't (usually) ask the WordPress software to provide information because it's not set up to provide data that's programmatically requested. Instead it's designed to display HTML pages with the data embedded. The WordPress software is specifically for humans to CRUD the data through a human-friendly interface. You'd write your own, as in Part A.

本文 显示了一些用于检索博客条目和用户评论的基本PHP,可能是您想要的大部分内容。 WordPress数据库格式已有详细记录: 这是一篇文章 ,它提供了更多的PHP示例来检索信息。

This article shows some basic PHP for retrieving blog entries and user comments, likely most of what you'd want. The WordPress database format is well-documented: here's an article that lays it out and provides more PHP examples for retrieving the information.

这篇关于从iPhone应用程序访问wordpress数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆