Hi, I am having a problem with sortables.  I can drag the images
around, but it doesn't update my records in my database... I'm not sure
if it's even calling the file... here is my code:

<div id="imageFloatContainer">
<img src="http://fashdax.com/gallery/I/2005/01/01/thumb/3.jpg"; id="3">
<img src="http://fashdax.com/gallery/I/2005/01/01/thumb/4.jpg"; id="4">
<img src="http://fashdax.com/gallery/I/2005/01/01/thumb/5.jpg"; id="5">
</div>
<script type="text/javascript">
function updateOrder(){
        var options = {
                method : 'post',
                parameters : Sortable.serialize('imageFloatContainer')
        };
        new Ajax.Request('http://www.fashdax.com/gallery_update.php',
options);
}
Sortable.create('imageFloatContainer',
{tag:'img',overlap:'horizontal',constraint: false, onUpdate :
updateOrder});
</script>

PHP FILE:
<?
include(config.php);

mysql_connect("$host","$user","$pass") or die("Database connections
error");
mysql_select_db("$dbase") or die("Database unavailable");

$i=1;
foreach($_POST['imageFloatContainer'] as $key=>$value) {
mysql_query("UPDATE main SET displayOrder='".$i."' WHERE id
='".$value."'");
$i++;
}

?>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to