Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 1st, 2004, 11:24 PM
Registered User
 
Join Date: Apr 2004
Location: St. Charles, MO, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cpkaiser
Default Chapter 4 pg 131

I apparently need another set of eyes here. I am in chpt 4 setting up the review. I get the following error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\test\movie_details.php on line 112

It has to do with this block of code but I can figure it out.

while($review_row = mysql_fetch_array($review_result))
{
     $review_flag =1;
     $review_title[] = $review_row['review_name'];
     $reviewer_name[] = ucwords($review_row['review_reviewer_name']);
     $review[] = $review_row['review_comment'];
     $review_date[] = $review_row['review_date'];
     $review_rating[] = generate_ratings($review_row['review_rating']);
}

-Chris
 
Old May 1st, 2004, 11:51 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

This usually indicates an error in the query itself.

Try including some error reporting at the query, one such method:

if (!$review_result = mysql_query("..blah blah blah.."))
{
   echo mysql_error();
}

If the query handle returns FALSE, it'll echo some error text and tell you what's wrong with the query. Since the result handle is FALSE, mysql_fetch_array cannot then fetch the array, that's why the error pops up there.

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old May 2nd, 2004, 11:41 AM
Registered User
 
Join Date: Apr 2004
Location: St. Charles, MO, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cpkaiser
Default

Still can't figure this out.

To see the code go to
http://www.chris-kaiser.net/code/movie_details.txt


-Chris
 
Old May 2nd, 2004, 01:50 PM
Registered User
 
Join Date: Apr 2004
Location: St. Charles, MO, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to cpkaiser
Default

I figured it out!

Had the following code:

$review_query = "SELECT
                         *
               FROM
                         reviews
               WHERE
                          review_movie_id ='".$_GET['movie_id']."'
               ORDER BY
                          review_date DESC";

$review_result = mysql_query($review_query,$link) or die(mysql_error());


after the while statement when it should have been before the while statement. DUH! Guess I just needed to step away for a while and come back to it.

-Chris




Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 pg 95 al2000 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 August 4th, 2008 09:18 PM
Chapter 4 Pg 117 Try It Out workib ASP.NET 3.5 Basics 1 April 7th, 2008 12:49 AM
chapter 5, pg 154 spizotfl BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 3 May 1st, 2007 03:08 PM
Chapter 4, pp 130-131 luciano991 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 15th, 2006 11:23 AM





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