]> Softwares of Agnibho - simpleipd.git/blobdiff - www/treatment.php
Bugfix
[simpleipd.git] / www / treatment.php
index a5426baf21a5cb683ef3101dde78e21ad9838216..20b6489557bf2393ad31bcfc22fa94d593f0308c 100644 (file)
@@ -25,7 +25,10 @@ if(!empty($_GET["pid"])){
   elseif(!empty($_POST["drug"])){
     $db->addDrug($pid, $_POST["drug"], $_POST["dose"], $_POST["route"], $_POST["frequency"], $_POST["date"], $_POST["time"], $_POST["duration"], $_POST["extra_note"]);
   }
-  $advice=$db->getAdvice($pid)->fetchArray()["data"];
+  $advice=$db->getAdvice($pid)->fetchArray();
+  if(!empty($advice["data"])){
+    $advice=$advice["data"];
+  }
   $list=$db->getDrugs($pid);
   $view="";
   while($drug=$list->fetchArray()){