Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9134907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:44:56+00:00 2026-06-17T08:44:56+00:00

I have an html/javascript page that creates some data which is similar to a

  • 0

I have an html/javascript page that creates some data which is similar to a graph, its an array of nodes, of different types, with different properties including multiple cross-references between nodes, and also sometimes text, which has to be stored on separate tables because it might be translated to other languages.

A json stringify might look like this:

[{"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}]

I send this to php page using ajax for storage.

So far I have only made basic mysql queries, like insert username, password, etc.

But now it looks like I have to insert things in one table, then look at another, insert ids from previous register there, and this several times, etc.

I am troubled about something bad happening on the middle of the insertions leaving my database with inconsistent data, I remember I was taught that this should be done in one single step to avoid that, but I can’t think of a way to do it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:44:57+00:00Added an answer on June 17, 2026 at 8:44 am

    I am troubled about something bad happening on the middle of the insertions leaving my database with inconsistent data, I remember I was taugth that this should be done in one single step to avoid that, but I can’t think of a way to do it.

    You need to do all that in a “transaction”.
    Use InnoDB table type, and study about transactions.
    It’s not rocket science, but needs some theory.

    See http://www.mysqltutorial.org/mysql-transaction.aspx
    Then http://dev.mysql.com/doc/refman/5.1/en/ansi-diff-transactions.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with some very basic examples that use HTML/CSS/JavaScript. I'd like
I have a mystery.html page that loads some javascript (as well as mootools). I
I have a page which uses javascript to add some textboxes to the page,
I have some html and JQuery that is used to create a page with
I have an html page with a single-line javascript comment as follows: // {key1:value1},
I have multiple javascript functions in my html page. One of them, by far
I have a very simple html page with the following javascript in it $(function()
I have one page website only using HTML, CSS and JavaScript. I want to
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
I have the following Javascript code add_num = { f: function(html, num) { alert(this.page);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.