Back to Week 6
Author's Last Name Author's First Name Book Title Genre
AustenJanePride and PrejudiceRomance
ByrneRhondaThe SecretSelf-help
ClancyTomWithout RemorseMystery/Thriller
CosgroveStephenWheedle on the NeedleChildren
de LintCharlesDingoFantasy
DickensCharlesOliver TwistLiterature
MorrisonToniSulaLiterature
RobertsNoraDance Upon the AirRomance
RobinsAmyToni Morrison (Journey to Freedom)Biographies
WilliamsHughWeb Database Applications with PHP/MySQLInstructional
<?php 
    
/* My variables */
    
$myName "R. Joanne Johnson";
    
$pageTitle "PHP for Web Developers 101";
    
$instructors "Jeramie Risinger and Bean Fairbanks";
    
$theSchool "<a href='http://www.lvsonline.com/index.shtml' target='_blank'>LVS</a>";
    
 
// code to connect to the database and call the book function
include('includes/bookFunctions.php'); 

 
//variable to set the books array that will call the bookFunctions
$booksgetBooks();
?> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">
@import url("common/week6a.css");


#current {
    font-family: "Brush Script Std", Papyrus, Arial, sans-serif;
    color: #FFFFFF;
    background-color: #CC9999;
    text-decoration: none;
}

</style>
</head>
<body>
<?php include('./includes/header.php'); ?>
<div id="mainContent">
    <div id="backDiv"><a href="http://www.rjoannej.com/php101/week6.php">Back to Week 6</a></div>
 
  <?php if(count($books))
{
    
//display books
?>    


  <table border="1"> 
      <tr>
          <th>Author's Last Name</th>
          <th>Author's First Name</th>
        <th>Book Title</th>
          <th>Genre</th>
      </tr>
       <?php
            
            
foreach($books as $book
            {
                echo 
"<tr>";//start the row

                //echo out each cell      
                
echo "<td>" $book['authorLast'] . "</td>";
                echo 
"<td>" $book['authorFirst'] . "</td>";
                echo 
"<td>" $book['bookTitle'] . "</td>";
                echo 
"<td>" $book['genre'] . "</td>";
                echo 
"</tr>";//end the row
            
}
            
        
?>    
  </table>
<?php
}else{
    
//display "nothing found!"
    
?>
    <h3>Sorry, we could not find any books. They are all out on loan!</h3>

    <?php
}//end if else
?>


  <div id="navDiv2">
<?php $currentPage basename ($_SERVER['PHP_SELF']); ?>
<table width="375" cellspacing="2" cellpadding="2" align="center">
  <tr>
    <td class="menu" <?php if($currentPage=="testConnect.php") {
   echo 
'id="current"';      
            }
        
?> ><a href="http://www.student30.lvsphp.com/testConnect.php">Connect</a></td>
        
    <td class="menu" <?php if($currentPage=="2darray.php") {
   echo 
'id="current"';      
            }
        
?> ><a href="http://www.rjoannej.com/php101/2darray.php">2D Array</a></td>
    
     <td class="menu" <?php if($currentPage=="sharedData.php") {
   echo 
'id="current"';      
            }
        
?> ><a href="http://www.student30.lvsphp.com/sharedData.php">Database</a></td>
     
      <td class="menu" <?php if($currentPage=="genre.php") {
   echo 
'id="current"';      
            }
        
?> ><a href="http://www.student30.lvsphp.com/genre.php">Genre</a></td>
    <td class="menu" <?php if($currentPage=="modified.php") {
   echo 
'id="current"';      
            }
        
?> ><a href="modified.php">Genre 2</a></td>
   
   
  </tr>
</table></div>

  <div id="showSource"><?php show_source(basename($_SERVER['PHP_SELF']));?></div>
  
 
 

</div>
</body>
</html>