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 October 30th, 2008, 06:37 AM
Registered User
 
Join Date: Oct 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default undefined variable

Hi! I have been trying to learn this and have run into a wall. I typed the code exactly as in the book (pg 114-115) and I kept getting this error "unexpected .<<. I searched the web and found the source code. It looked the same so I just copied and pasted....just to see if it would work. It did, but now I get the error, "Undefined variable: movie_details. Below is the code I have, the var $movie_details is used twice and only the second one gives the error. If someone would assist me I would REALLY appreciate it!

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

Reply With Quote
  #2 (permalink)  
Old October 31st, 2008, 06:11 AM
Registered User
 
Join Date: Oct 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As I was, the code available on the site is missing $movie_details = ''; just before the loop. I thought I'd write just in case I'm not the only one having this problem. Mine works great now!

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
Undefined Variable aspire Beginning PHP 4 July 12th, 2006 07:00 AM
Undefined variable najib Beginning PHP 4 July 1st, 2005 08:12 AM
undefined variable !! cody44 Beginning PHP 3 January 20th, 2005 05:47 PM
Undefined Variable fpolan Beginning PHP 9 July 15th, 2004 06:24 AM
Undefined Variable Some Help! knight Beginning PHP 7 February 19th, 2004 07:07 AM



All times are GMT -4. The time now is 07:16 PM.


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