Paste2 Logo
  1. <?php
  2.  
  3.         error_reporting( E_ALL ); ini_set( 'display_errors', 'on' );
  4.  
  5.         mysql_connect( "localhost", $username, $password );
  6.        
  7.         @mysql_select_db($database) or die( "Unable to select database");
  8.         $query = "SELECT * FROM booking";
  9.         $result = mysql_query( $query ) or die( mysql_error() );
  10.        
  11.         echo '<b><center>Database Output</center><b>';
  12.        
  13.         while( $row = mysql_fetch_array( $result ) ) {
  14.                 /**
  15.                  * This will now loop through each result from the query
  16.                  * Row is an array, so you access it through $row['column_name']; (column_name) is
  17.                  * the column of the MySQL database table
  18.                  */
  19.                 echo "<p><b>$row['artist'] $row['price']</b></p>";
  20.                 echo "<p>Company: $row['company']";
  21.                 # Add more here of what ever you want, keep building it up
  22.         }
  23.  
  24. ?>