Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 10th, 2006, 04:55 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch. 4 pg114-116

I'm having problems getting anything to show up in the webpage with the example:

<?php
//connect to database
//ignore this, i changed it when posting
$link = mysql_connect("localhost", "username", "password")
    or die(mysql_error());
//use the correct database
mysql_select_db("moviesite")
    or die (mysql_error());
//pour the results into result query
$query = "SELECT movie_name, movie_director, movie_leadactor " .
            "FROM movie";
$result = mysql_query($query, $link)
    or die(mysql_error());
$num_movies = mysql_num_rows($result);

//Designing the Movie Table Heads
$movie_header = <<<EOD
<h2><center>Movie Review Database</center></h2>
<table width="70%" border ="1" cellpadding="2"
    cellspacing= "2" align="center">
<tr>
    <th>Movie Title</th>
    <th>Movie Director</th>
    <th>Movie Lead Actor</th>
</tr>
EOD;
echo "I'm getting pissed!!!!!!!!!!";
$movie_details = ' ';
while ($row = mysql_fetch_array($result)){
    $movie_name = $row['movie_name'];
    $movie_director = $row['movie_director'];
    $movie_leadactor = $row['movie_leadactor'];
    $movie_details .= <<<EOD
<tr>
        <td> $movie_name </td>
        <td> $movie_director </td>
        <td> $movie_leadactor </td>
</tr>
EOD;
}
$movie_details .= <<<EOD
<tr>
<td>$nbsp;</td>
</tr>
<tr>
<tr>Total :$num_movies Movies</td>
</tr>
EOD;
?>

any suggestions??

Reply With Quote
  #2 (permalink)  
Old May 11th, 2006, 01:53 AM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You haven't closed the <table> tag, so it won't show anything.

Reply With Quote
  #3 (permalink)  
Old May 11th, 2006, 11:36 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks, (should have read further.) I appreciate it!!!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 2 - Ex 2 jkiernander BOOK: Ivor Horton's Beginning Visual C++ 2005 0 December 29th, 2007 08:47 PM
Answer to the nightmare on pages 114, 115, 116, mobyme BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 April 23rd, 2007 07:53 PM
Ch. 4 & Ch. 12 athena BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 23rd, 2004 10:54 AM
CH.15 NEED HELP stacy BOOK: Beginning ASP 3.0 1 January 21st, 2004 03:37 AM
ch. 2 with C# Justin BOOK: Beginning ASP.NET 1.0 1 July 10th, 2003 03:59 PM



All times are GMT -4. The time now is 07:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.