Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Save and restore position X Y of HTML elements in a DB with PHP

Im trying to make a floor planner like page for tables of a Restaurant. Every square of the page represent a table and they are draggable.

  <div  id="drag-1" class="draggable">
    <p> Table 1 </p>
  </div>
  <div id="drag-2" class="draggable">
    <p> Table 2 </p>
  </div>
  <div id="drag-3" class="draggable">
    <p> Table 3 </p>
  </div>

After dragging they have new coordinates changed appling a transform: translate() made by the js function.

The question is how I can save the coordinates in a MySQL DB with PHP and restore the position of every square after refreshing page?

Here is complete code to see it working

https://jsfiddle.net/1sfx4ubn/

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!