I have a backbone.js model with some defaults and an url:
var Box = Backbone.Model.extend({ url: \"./save.php\", defaults: { x: 0, y:
You forgot to send ID.
//$id = $_POST['cid'];
Make Id to AUTO_INCREMENT and remove from code:
$id = $_POST['cid'];
mysql_query("INSERT INTO boxes (x, y, w, h) VALUES('$x', '$y', '$w', '$h') ") or die(mysql_error());