public function SearchRecipeByID($ID) { $dbl=new DBLayer(); $arr= $dbl->get_CollectionObjectbyID($ID); //$obj=iterator_to_array($cursor); if (!is_null($arr)) { echo "<table border='1' width='300'>"; echo "<th>Name</th><th>Description</th><th>URL</th><th>Image</th>"; echo "<th>About</th><th>Author</th><th>instructions</th><th>Ingredients</th>"; foreach ($arr as $value) { /*Loop through returned array values*/ $this->PrintRecipe($value); echo"<tr>"; echo "<td>".$this->printNameHtmlTag()."</td>"; echo "<td>".$this->printDescriptionHtmlTag()."</td>"; echo "<td>".$this->printUrlHtmlTag()."</td>"; echo "<td>".$this->printImageHtmlTag()."</td>"; echo "<td>".$this->printaboutHtmlTag()."</td>"; echo "<td>".$this->printauthorHtmlTag()."</td>"; echo "<td>".$this->printinstructionsHtmlTag()."</td>"; echo "<td>".$this->printingredientsHtmlTag()."</td>"; echo "</tr>\n"; } echo "</table>\n"; // echo "<script> // $(document).ready(function(){ // document.getElementById('name').value ={$this->printNameHtmlTag()}; // // }); // </script>"; $this->result=1; } else { $this->result=0; } return $this->result; }