Guest User

Untitled

a guest
Jun 26th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.    <?php
  2.     $recipe = "Coffee and Date Dough"; // this isn't normally hard coded..
  3.     echo('<table width="25%" border="1">');
  4.  
  5.     // This basically gets all of the recipe into an array
  6.     $query = mysql_query("SELECT * FROM recipe WHERE recipe='{$recipe}'");
  7.     while($row = mysql_fetch_array($query)){
  8.         // Couldn't think of a better way to count to 18 without using something like this.
  9. for($count = 1; $count < 19; $count++) {
  10.          $ing = "ing".$count;
  11.          $per = "per".$count;
  12.  
  13.          // Echo out the table information
  14.          echo("<tr><td>$row[$ing]</td><td>$row[$per]</td></tr>");
  15.         }
  16.     }
  17.     echo("</table>");
  18.    ?>
Advertisement
Add Comment
Please, Sign In to add comment