How to connect my shopping cart to Mysql through PHP
Hi everyone,
I am currently using jquery iu and it is working like a charm.
One of the things that I come across is using the demo "shopping cart" to connect to my "database".
For example, when I drag an item, the php script should perform select from Mysql. When I drop it into my shopping cart, the php script should add/update the dragged-item into a new table. In another word, when I do drag and drop, I want php to select the stuff from the database table and then updates it to another database table.
My question is, how do I call php script using javascript .draggable and .droppable?
$("#catalog li").draggable({
appendTo: "body",
helper: "clone"
//call php
});
$("#cart ol").droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
accept: ":not(.ui-sortable-helper)",
drop: function(event, ui) {
$(this).find(".placeholder").remove();
$("<li></li>").text(ui.draggable.text()).appendTo(this);
var mes = "success";
$("<li></li>").text(mes).appendTo(this);
//call php
}
})
Or is there a better way to solve this problem?
Am I being clear? Please leave a message here if you can't understand my question.