home *** CD-ROM | disk | FTP | other *** search
/ Master Visually: Macrome…a Dreamweaver 8 & Flash 8 / MasterVisuallyDreamweaver8AndFlash8.iso / mac / Samples / ch16 / flower_details.php < prev    next >
PHP Script  |  2005-12-28  |  2KB  |  62 lines

  1. <?php require_once('Connections/cxn_flower.php'); ?><?php
  2. $maxRows_DetailRS1 = 10;
  3. $pageNum_DetailRS1 = 0;
  4. if (isset($_GET['pageNum_DetailRS1'])) {
  5.   $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
  6. }
  7. $startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;
  8.  
  9. mysql_select_db($database_cxn_flower, $cxn_flower);
  10. $recordID = $_GET['recordID'];
  11. $query_DetailRS1 = "SELECT * FROM flower WHERE Item = $recordID ORDER BY Name ASC";
  12. $query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
  13. $DetailRS1 = mysql_query($query_limit_DetailRS1, $cxn_flower) or die(mysql_error());
  14. $row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
  15.  
  16. if (isset($_GET['totalRows_DetailRS1'])) {
  17.   $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
  18. } else {
  19.   $all_DetailRS1 = mysql_query($query_DetailRS1);
  20.   $totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
  21. }
  22. $totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
  23. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  27. <title>Untitled Document</title>
  28. </head>
  29.  
  30. <body>
  31.         
  32. <table border="1" align="center">
  33.   
  34.   <tr>
  35.     <td>Name</td>
  36.     <td><?php echo $row_DetailRS1['Name']; ?> </td>
  37.   </tr>
  38.   <tr>
  39.     <td>Item</td>
  40.     <td><?php echo $row_DetailRS1['Item']; ?> </td>
  41.   </tr>
  42.   <tr>
  43.     <td>Color</td>
  44.     <td><?php echo $row_DetailRS1['Color']; ?> </td>
  45.   </tr>
  46.   <tr>
  47.     <td>Price</td>
  48.     <td><?php echo $row_DetailRS1['Price']; ?> </td>
  49.   </tr>
  50.   <tr>
  51.     <td>Description</td>
  52.     <td><?php echo $row_DetailRS1['Description']; ?> </td>
  53.   </tr>
  54.   
  55.   
  56. </table>
  57.  
  58. </body>
  59. </html><?php
  60. mysql_free_result($DetailRS1);
  61. ?>
  62.