</td> <td height="30px" width="200px"><?php echo $_POST['treatment5']; ?> </td> </tr> </table> </font> <?php $new_content = ob_get_clean(); $html = $new_content; $pdf->WriteHTML($html); $pdf->output("sample.pdf"); $fp = fopen("sample.pdf", 'r'); $content = fread($fp, filesize("sample.pdf")); $content = addslashes($content); fclose($fp); $user = $_SESSION['logged_in_patient']; $sql = "SELECT * FROM patient where username='******'"; $row = $conn->query($sql); foreach ($row as $single) { if ($single['pre_1'] == null) { $prescription = 'pre_1'; break; } if ($single['pre_2'] == null) { $prescription = 'pre_2'; break;