prepare("SELECT image FROM forums WHERE post_id = :pid"); $oldImg->bindParam(":pid", $pid); $oldImg->execute(); $oldImg = $oldImg->fetch(PDO::FETCH_ASSOC); //$oimg = $_POST["orderedImgs"]==""?NULL:$_POST["orderedImgs"]; //if($oimg != NULL){ //$oimg = str_replace("-", ",", $oimg).","; //$oimg = str_replace("jpg", ".jpg", $oimg); //$oimg = str_replace("jpeg", ".jpeg", $oimg); //$oimg = str_replace("png", ".png", $oimg); //} if($file["name"][0]!=NULL){ for($i=0; $iprepare("UPDATE forums SET section = :scn, type = :typ, title = :ttl, content = :ctt, image = :img WHERE post_id = :pid"); $stmt->bindParam(":scn", $sbj); $stmt->bindParam(":typ", $typ); $stmt->bindParam(":ttl", $ttl); $stmt->bindParam(":ctt", $ctt); $stmt->bindParam(":img", $oimg); $stmt->bindParam(":pid", $pid); $stmt->execute(); if($stmt){ msg("Edits saved."); header("Location: /forum/post/?post=$pid"); }else{ reportError("Error submitting post edit"); msg("Something's broken. It has been reported."); header("Location: /forum/post/?post=$pid"); } ?>