Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //function to save position
- function saveBlock(){
- $data = $_POST;
- //print_r($data);
- foreach($data as $key => $value){
- foreach($value as $key2 => $value2){
- $item = explode("_",$value2['id']); //split item_3 to get 3 and that is our item table id
- $value2['id'] = $item[1];
- $col = explode("_", $value2['column']); //split
- $value2['column'] = $col[1];
- ///
- $new_column = $value2['column'];
- $new_order = $value2['order'];
- $id = $value2['id'];
- $query = "UPDATE `metu_builder` SET `column`='$new_column', `order`='$new_order' WHERE `ID`='$id'";
- if(mysql_query($query))
- continue;
- else{
- echo 'Error query';
- exit();
- }
- }
- }
- return 'Saved successfully';
- }
Advertisement
Add Comment
Please, Sign In to add comment