$pdo=new PDO('mysql:host=localhost;dbname=simeya_db','simeya_db','@SdB#917!=Ny'); $id=intval($_POST['id']); $type=$_POST['type']??''; $content=$_POST['content']??''; if($type==='section'){$pdo->prepare('UPDATE simeya_template_sections SET section_content=? WHERE section_id=?')->execute([$content,$id]);} elseif($type==='block'){$pdo->prepare('UPDATE simeya_section_blocks SET block_content=? WHERE block_id=?')->execute([$content,$id]);} echo json_encode(['status'=>'success']); ?>