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 6558523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:12:36+00:00 2026-05-25T13:12:36+00:00

problem with passing variables (php, sql, jquery draggable) Hi, this is my problem: updating

  • 0

problem with passing variables (php, sql, jquery draggable)

Hi,

this is my problem: updating sql via jquery draggable.

I have two columns in a page populated by sql. drag and drop from one column to another works. My problem, i have problem passing the row id into droppable for sql update. Can you help?

this is the html:

<div class="result_box1">
    <p>&nbsp;</p>
    <div>
        <span>Job Number</span>
        <span>Manager</span>
      <?php do { ?>
        <div class="draggable data_row" >
          <span><?php echo $row_diag['job_number']; ?></span>
          <span><?php echo $row_diag['manager_label']; ?></span>
        </div>
        <?php } while ($row_diag = mysql_fetch_assoc($diag)); ?>
    </div>
  </div>

and here’s the javascript:

  $(document).ready(function() {
    $(".draggable").draggable();
    $(".droppable").droppable({
        drop: function() {update_sql(); }
    });
  });
  • 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-05-25T13:12:37+00:00Added an answer on May 25, 2026 at 1:12 pm

    I’m not very clear on what the “problem” is. Assuming you don’t know what approach to use to begin with: you could store the row id as a data attribute on the data_row div. So the PHP to output the row would be:

    <div class="draggable data_row" data-rowid="<?= $row_diag['rowid'] ?>">
        <span><?php echo $row_diag['job_number']; ?></span>
        <span><?php echo $row_diag['manager_label']; ?></span>
    </div>
    

    If you’re using jQuery already, you can retrieve the value using the .data() method:

    $(".droppable").droppable({
        drop: function(evt, ui) {
            var droppedRowid = ui.draggable.data('rowid');
            update_sql(droppedRowid); 
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am passing variables to submit file via AJAX but I have problem when
This is a follow up to my previous question: Problem passing parameters via Iframe
I have problem with passing variables through views. But, first some code // i
I have a problem passing by reference int or string variables to C++ ActiveX
I'm experimenting with WCF Services, and have come across a problem with passing Interfaces.
My problem is similar to Django Passing Custom Form Parameters to Formset Ive have
I am having a problem with views. I have a view and am passing
This is a general question, I have two pages, a main and a backgound
I'm passing a URL variable to a PHP page that is outputting an XML
This phpinfo() demonstrates the problem. I'm passing the URL a query string of: ?qwerty=asdfg

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.