prepare($sql); $stmt->bind_param("i", $user_id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $form_action = "updatelp.php"; } else { $form_action = "addlp.php"; } $gambar_utama_required = empty($row['gambar_utama']) ? 'required' : ''; $gambar_tentang_required = empty($row['gambar_tentang']) ? 'required' : ''; $gambar_keunggulan_required = empty($row['gambar_keunggulan']) ? 'required' : ''; $stmt->close(); $conn->close(); ?>