I'm coding a website that involves storing very simple data, just a very long list of names with no additional data, on the server. As this data is so simple, I don't really want to use MySQL (it would be a bit too clunky) so I'm asking what's the best way to store very simple data on the server.

我正在为一个网站编码,这个网站需要在服务器上存储非常简单的数据,只是一个很长的名称列表,没有附加的数据。由于这些数据非常简单,所以我并不想使用MySQL(可能会有点笨拙),所以我想知道在服务器上存储非常简单的数据的最佳方式是什么。

I definitely would favour speed over anything else, and easy access to the data via javascript and AJAX would be very good too as the rest of the site is coded in javascript/jQuery. I don't really care if the data can be viewed freely (as it will be available anyway), as long as it can't be changed by unauthorised users.

我肯定会优先考虑速度,通过javascript和AJAX轻松访问数据也会很好,因为站点的其余部分都是用javascript/jQuery编写的。只要未经授权的用户不能对数据进行修改,我并不关心这些数据是否可以自由查看(因为无论如何它都是可用的)。

3 个解决方案

#1


3

Use an XML file that is web-accessible. Then you can query the XML file from the browser if need be, and still parse/write it in PHP. You'll want to use the flock function in PHP to make sure that two instances of a page don't try to write to the file at the same time.

使用web可访问的XML文件。然后,如果需要,您可以从浏览器查询XML文件,并仍然使用PHP解析/编写它。您将希望在PHP中使用flock函数,以确保页面的两个实例不会同时写入文件。

更多相关文章

  1. JS获取文件名的方法
  2. 使用Jquery Ajax更改按钮的颜色(从外部PHP文件接收颜色)
  3. 图表。js数据数组使用PHP, MySQL。如何从JSON数组定义数据源?
  4. 将JavaScript对象转换为要插入关系数据库的数组
  5. jQuery Slimbox没有正确请求文件
  6. JavaScript数据类型的一些注意点(2)
  7. 将对象值传递给指令而不是任何其他数据变量
  8. 如何使用Angular ng-repeat对数据进行分组?
  9. jqGrid 数据加载完事件 loadComplete 使用

随机推荐

  1. Android如何使用XML创建一个环形渐变颜色
  2. android重写Dialog(接上文)
  3. android 自定义线程池ThreadPoolUtils工
  4. Android(Java):自定义控件
  5. android:persistentDrawingCache 的含义
  6. Android studio使用教程
  7. Android 根文件系统启动分析
  8. 让一个小图片重复出现,形成一张大图片
  9. Android在Button按钮上同时显示文字和图
  10. android之CheckBox