Wrox Programmer Forums

Need to download code?

View our list of code downloads.

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

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 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 February 16th, 2006, 05:08 AM
Registered User
 
Join Date: Feb 2006
Location: , , South Africa.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default table2.php in chapter 4 - blank page ??

I figured I should put this in a new thread then someone may notice it ;)

table2.php in chapter 2 will simple not work for me, I just get a blank page.. all the other exercises up till this one have worked with no problem...

I've also tried the downloaded one, which does the same thing...

Any ideas anyone??

I've entered it as follows:

Code:
<?php

$link = mysql_connect("localhost", "bp5am", "bp5ampass")
    or die(mysql_error());

mysql_select_db("moviesite");
    or die(mysql_error());

$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);

$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;

$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>
        <td>Total: $num_movies Movies</td>
    </tr>
EOD;

$movie_footer ="</table>";

$movie = <<<MOVIE
    $movie_header
    $movie_details
    $movie_footer
MOVIE;

echo "There are $num_movies movies in our database";
echo $movie;
"Those who do not believe in magic will never find it" - Roald Dahl
Reply With Quote
  #2 (permalink)  
Old February 16th, 2006, 05:24 AM
Registered User
 
Join Date: Feb 2006
Location: , , South Africa.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I have just figured it out.. :D

Code:
mysql_select_db("moviesite");
    or die(mysql_error());
Notice the semi-colon after mysql_select_db("moviesite")
This is what happens when you don't have a compiler which complains about stupid mistakes like this

Strange thing is the downloaded version does not have this error, and yet it's still giving me a blank page..

"Those who do not believe in magic will never find it" - Roald Dahl
Reply With Quote
  #3 (permalink)  
Old April 13th, 2009, 07:27 PM
Authorized User
 
Join Date: Dec 2007
Location: greaternoida, u.p, India.
Posts: 65
Thanks: 9
Thanked 2 Times in 2 Posts
Send a message via AIM to sandeepgreaternoida Send a message via MSN to sandeepgreaternoida Send a message via Yahoo to sandeepgreaternoida
Default

Quote:
Originally Posted by redarrow View Post
Ok, I have just figured it out.. :D

Code:
mysql_select_db("moviesite");
    or die(mysql_error());
Notice the semi-colon after mysql_select_db("moviesite")
This is what happens when you don't have a compiler which complains about stupid mistakes like this

Strange thing is the downloaded version does not have this error, and yet it's still giving me a blank page..

"Those who do not believe in magic will never find it" - Roald Dahl
Is there any solution for chapter-4, table2-rev01.php it does not work in browser only i get the blank page ? others like table2-rev02.php and table3.php are working absolutely fine on the browser.
i think there must be some publishing mistake.
any way if u have got any solution any solution for that pls. let me know.
__________________
sandeep gupta
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
Code on table2.php aztek_2006 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 April 13th, 2009 07:31 PM
Ch 5 - form4.php loads itself blank Jotag BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 September 3rd, 2006 02:09 PM
why blank page? gilgalbiblewheel Classic ASP Databases 6 December 31st, 2004 09:30 PM
PHP/Apache install issue.."blank" browser page dgr72371 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 6 June 15th, 2004 11:51 AM
DataGrid Updates BLANK PAGE (Chapter 17) happyhorseygal BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 April 8th, 2004 01:11 PM



All times are GMT -4. The time now is 08:27 PM.


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