English 中文(简体)
我怎么能把我的贾瓦特物体与JSON/PHP/Mysql一道在用户返回时重载?
原标题:How would I save my Javascript objects with JSON/PHP/Mysql, to re-load them upon user return?

I m 努力创建一种“and箱”,许多用户将在其自己的“和箱子”上登记并创建可观的“no”。 我热爱能够在每次修改之后拥有汽车,但首先,试图把我的 Java印物品存放在MySQL。

我对贾瓦特、PHP和MySQL说了新话,但JSON似乎是这项任务的最好朋友。 这里有一个粗略的例子:

node1.pos
node1.name
node1.content
node1.siblings

* Note: The actual node will home more characteristics, some with potential relevant information.

我的目标是让用户操纵每个节点(拖拉、与兄弟姐妹挂钩、改名等),然后对网页进行重新定位,将“盒子”重新注入正确位置的节点,并附上与其有关的所有正确数据。

我认为,我可以处理将聚居于运河的功能,但把物体从MySQL和Javascript之间转移是我所混淆的。 有办法的物体是否会造成任何问题?

Does anyone have any help, advice or reference material that could help me out?

最佳回答
  1. 我建议你设立一个网络服务,储存用户发送的任何数据。 请打电话http://server.net/store.php。

  2. 然后,客户将利用Java语将有意义的数据与一些用户成像相联。

    var dataPacket = {
        userCredentials: 77777777, /* whatever is sensible */
        nodes: [ {id: 1, posX: 10, posY: 345 }, {id: 2, posX: 5, posY: 136} ]
    };
    
  3. 然后,客户会向服务器发送数据,然后由j Query + AJAX......

    $.ajax({
       type: "POST",
       url: "http://server.net/store.php",
       dataType: "json",
       data: dataPacket
     });
    
  4. 然后,在服务器方面,将对数据进行检查,以了解有效的用户证书,然后可以着手在某种数据库中节省收到的JSON编码数据,事实上这只是一个便衣。

  5. 建立从数据库读到的网络服务,并退还以前储存的数据。 请打电话http://server.net/load.php

  6. 当用户需要装上他以前做些什么时,客户将使用 Java本要求数据......

    $.ajax({
       type: "POST",
       url: "http://server.net/load.php",
       dataType: "json",
       data: {
           userCredentials: 77777777, /* whatever is sensible */
       }
       success: function(dataPacket) {
          /* process the received dataPacket */
       }
     });
    

请注意,该守则取决于 j,而且作为例子提供,我实际上没有测试过。


另见:

希望这一帮助。

上帝保!!

问题回答

我的顶部建议:

<>Save edits on the air:

建立一个PHP网页,只接收用户提出的PPOST申请(青年显然希望有某种形式的认证,以便随机点击该网页时有随机数据,而这是另一个问题)。 该网页将完全负责接收用户提出的美国航天中心的请求。

• 创建你的沙箱子,使用诸如j Query s UI图书馆(,特别是<>m>,如果你重读,则使用事先写的东西,不要试图书写你自己。 这将是一个PHP网页,该网页将仅仅装上您的AJAX处理网页已经储存的任何价值。 http://jqueryui.com/demos/draggable/“rel=“nofollow”>drag和退学方法。 页: 1

在用户记录之后,按要求添加/定位要素是微不足道的。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...