Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 18th, 2005, 09:11 PM
Authorized User
Join Date: Aug 2005
Location: , , Canada.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 10 - powers and enemies

I followed the book (entering the code) and input Powers to the char_power table.

Then I created the first and only Character choosing 1 or 2 powers. This character has no enemies. An error is thrown because $enemies is not defined in char_transact.php. (I copied the downloaded char_transact.php file so I did not create any typo errors.)

The statement - if($enemies != '') {
     then etc;

I fixed this with the following:
if (isset($enemies) && $enemies != '') {
Also if you update the character and do not select any Powers then $powers is undefined.

I changed - if($powers != "") {
to the following:
if (isset($powers) && $powers != "") {

In charlist.php I made the following change to skip $powers if it is not set (defined):

//$pow = ($powers[$row['id']]=='' ? 'none' :$powers[$row['id']]);
if(!isset($powers) || ($powers[$row['id']]== ''))
   $pow = 'none';
        $pow = $powers[$row['id']];

When I click the character link in charlist.php to edit my character charedit.php comes up with all the data filled in except there are no Powers selected. To make any update (or none at all) the Powers have to be re-selected. I have not figured out how to fix this.

I would be glad of help if somebody out there has the answer to this problem.

Reply With Quote

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
chap10 - If a hero has no enemies bill_the_cat BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 May 25th, 2008 05:17 AM
Chapter 10 gogeo BOOK: Beginning Access 2003 VBA 1 January 22nd, 2006 09:41 AM
Chapter 10 czambran BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 March 29th, 2005 09:35 AM
Chapter 10 columbiasmiles JSP Basics 0 May 17th, 2004 08:09 PM

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

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