グラフに似たいくつかのデータを作成するhtml/javascriptページがあります。これは、ノード間の複数の相互参照を含むさまざまなプロパティを持つさまざまなタイプのノードの配列であり、場合によってはテキストも保存する必要があります他の言語に翻訳される可能性があるため、表を分けてください。
json の stringify は次のようになります。
[{"type":"bid-rama","parent":-1,"child":1,"color":"silver","state":{"bid":[0,0,1],"length":3,"turn":"lho","main":{"s":"a83","h":"kq84","d":"jt52","c":"94"},"rho":{"s":"kj92","h":"j3","d":"q93","c":"qj83"},"lho":{"s":"t7","h":"9765","d":"k87","c":"at76"},"cho":{"s":"q654","h":"at2","d":"a64","c":"k52"}}},{"type":"bid-nodo","parents":[0],"fila":2,"children":{"0":2,"-1":4,"5":6},"options":{"0":"mog","-1":"mop","5":"mor","4":"blue","7":"red"},"texts":{"blue":"texto axu","red":"testo roho"},"state":{"bid":[0,0,1],"turn":"main"}},{"type":"bid-rama","parent":1,"child":3,"color":"green","state":{"bid":[0,0,1,0],"length":0,"turn":"lho"}},{"type":"bid-nodo","parent":2,"fila":3},{"type":"bid-rama","parent":1,"child":5,"color":"purple","state":{"bid":[0,0,1,-1],"length":0,"turn":"lho"},"texts":{"0":"blalb","1":"hrhrhr ","2":"meee[r][s] fas","3":"[10] is 10 [d] no"}},{"type":"red-dot","parent":4,"fila":3},{"type":"bid-rama","parent":1,"child":7,"color":"green","state":{"bid":[0,0,1,5,0,0,0],"length":0,"turn":"lho"}},{"type":"bid-ctr","parent":6,"fila":3,"state":{"bid":[0,0,1,5,0,0,0],"contract":5,"declarer":"south"},"color":"yellow","playnode":8},{"type":"cpl-ctr","parents":[7],"fila":1,"trump":"n","declarer":"main","color":"yellow","child":9,"state":{"main":{"s":"a83","h":"kq84","d":"jt52","c":"94"},"rho":{"s":"kj92","h":"j3","d":"q93","c":"qj83"},"lho":{"s":"t7","h":"9765","d":"k87","c":"at76"},"cho":{"s":"q654","h":"at2","d":"a64","c":"k52"},"turno":"lho","trick":"","history":"","trNS":0,"trEW":0}},{"type":"cpl-rama","parent":8,"child":10,"fila":2,"color":"yellow","state":{"main":{"s":"a83","h":"kq84","d":"jt52","c":"94"},"rho":{"s":"kj92","h":"j3","d":"q93","c":"qj83"},"lho":{"s":"t7","h":"9765","d":"k87","c":"at76"},"cho":{"s":"q654","h":"at2","d":"a64","c":"k52"},"turno":"lho","trick":"","history":"c6c2cqc4c3c9ca","trNS":0,"trEW":0}},{"type":"red-dot","parent":9,"fila":2}]
ストレージに ajax を使用して、これを php ページに送信します。
これまでのところ、ユーザー名、パスワードの挿入など、基本的な mysql クエリのみを作成しました。
しかし、今では、あるテーブルに物を挿入してから、別のテーブルを見て、以前のレジスタから ID を挿入し、これを数回行う必要があるようです。
挿入の途中でデータベースに一貫性のないデータが残るという問題が発生しているのではないかと悩んでいます。これを回避するには、これを 1 つのステップで行う必要があると教えられたことを覚えていますが、それを行う方法が思いつきません。 .