Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Created November 5, 2011 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterdavis/1341162 to your computer and use it in GitHub Desktop.
Save walterdavis/1341162 to your computer and use it in GitHub Desktop.
<?php
define('MYACTIVERECORD_CONNECTION_STR', 'mysql://test:pass@localhost/test');
require_once('lib/MyActiveRecord.php');
class widgets extends MyActiveRecord{};
foreach($_POST['sort_me'] as $k => $v){
if($widget = MyActiveRecord::FindById('widgets', $v)){
$widget->position = $k;
$widget->save();
}
}
header('x',true,200);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment