title: MySQL Item Database with JQuery Droppable
body: <p><strong>Simple Version of my question:</strong>
  Is it possible to take a JQuery UI draggable image's ID, when it's dropped into my goal droppable, and use the ID as a value and update a field in one of my MySQL database tables when the draggable image is dropped?</p>
  
  <p><strong>Technical Version of my question:</strong>
  I used a tutorial from a website to make a drag and drop inventory feature for a game I am currently working on.</p>
  
  <p>Anyways, I cannot give a direct link to my site, as it requires a login, and I haven't gotten my system to work beyond my IP address, but here is what I am basically trying to do:</p>
  
  <p>My drag and drop works great, but I need it to update a MySQL Database, I know for the tutorial I have linked, it has a second part that does it, but not the way I need.</p>
  
  <p>So my user's inventory has it's own table with the following fields:</p>
  
  <p>bid: this is the user id stored as a 32 digit unique random number
  itemid: this is an 8 digit item code</p>
  
  <p>All the information for the user and the objects are Inner Joined to combine the information into PHP Variables, I split these up over different tables because I have multiple sites that adjust each one. So far everything works here.</p>
  
  <p>I use <code>mysql_fetch_array()</code> to load the items into the inventory box to make them draggable.</p>
  
  <p>My items are formatted as so:</p>
  
  <pre><code>img src='$cheesepic' id='$itemid' class='object cheese'
  $cheesepic == "http://motb.isgreat.org/objects/" . $itemid . ".png";
  </code></pre>
  
  <p>and <code>$item</code> id is stolen directly from the inventory table. The <code>CSS classes</code> object scales the image to my desired size, I like it better than thumbnails since it caches better because I use so many different sizes of the objects around the site. The cheese class is for dragging so it is only accepted by the cheese droppable.</p>
  
  <p>Now I have another table in my database for the equipped objects. So the fields there are bid and cheese. I would like to be able to update my database with the ID of the image that was dragged into the droppable. And delete that row if they drag it out of the droppable and into the inventory droppable again.</p>
  
  <p>Thanks for your help.</p>